Skip to main content

prove

Prove validity of logical statements by negation and satisfiability checking. If the negation is unsatisfiable, the original statement is valid. Otherwise a counterexample is returned.

설치로 이동

소스 정보

저장소
Z3Prover/z3
최근 소스 활동
2026년 3월 11일 19:51
감지된 SKILL.md 언어
영어
스타
12,704
포크
1,690

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
prove
description
Prove validity of logical statements by negation and satisfiability checking. If the negation is unsatisfiable, the original statement is valid. Otherwise a counterexample is returned.
Given a conjecture (an SMT-LIB2 assertion or a natural language claim), determine whether it holds universally. The method is standard: negate the conjecture and check satisfiability. If the negation is unsatisfiable, the original is valid. If satisfiable, the model is a counterexample. # Step 1: Prepare the negated formula Action: Wrap the conjecture in `(assert (not ...))` and append `(check-sat)(get-model)`. Expectation: A complete SMT-LIB2 formula that negates the original conjecture with all variables declared. Result: If the negation is well-formed, proceed to Step 2. If the conjecture is natural language, run **encode** first. Example: to prove that `(> x 3)` implies `(> x 1)`: ```smtlib (declare-const x Int) (assert (not (=> (> x 3) (> x 1)))) (check-sat) (get-model) ``` # Step 2: Run the prover Action: Invoke prove.py with the conjecture and variable declarations. Expectation: The script prints `valid`, `invalid` (with counterexample), `unknown`, or `timeout`. A run entry is logged to z3agent.db. Result: On `valid`: proceed to **explain** if the user needs a summary. On `invalid`: report the counterexample directly. On `unknown`/`timeout`: try **simplify** first, or increase the timeout. ```bash python3 scripts/prove.py --conjecture "(=> (> x 3) (> x 1))" --vars "x:Int" ``` For file input where the file contains the full negated formula: ```bash python3 scripts/prove.py --file negated.smt2 ``` With debug tracing: ```bash python3 scripts/prove.py --conjecture "(=> (> x 3) (> x 1))" --vars "x:Int" --debug ``` # Step 3: Interpret the output Action: Read the prover output to determine validity of the conjecture. Expectation: One of `valid`, `invalid` (with counterexample), `unknown`, or `timeout`. Result: On `valid`: the conjecture holds universally. On `invalid`: the model shows a concrete counterexample. On `unknown`/`timeout`: the conjecture may require auxiliary lemmas or induction. # Parameters | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | conjecture | string | no | | the assertion to prove (without negation) | | vars | string | no | | variable declarations as "name:sort" pairs, comma-separated | | file | path | no | | .smt2 file with the negated formula | | timeout | int | no | 30 | seconds | | z3 | path | no | auto | path to z3 binary | | debug | flag | no | off | verbose tracing | | db | path | no | .z3-agent/z3agent.db | logging database | Either `conjecture` (with `vars`) or `file` must be provided.
GitHub에서 보기