mirror of
https://github.com/Z3Prover/z3
synced 2026-03-15 09:39:59 +00:00
Add action/expectation/result structure to all skill definitions
Each step in every SKILL.md now carries labeled Action, Expectation, and Result blocks so the agent can mechanically execute, verify, and branch at each stage. Format chosen after comparing three variants (indented blocks, inline keywords, tables) on a prove-validity simulation; indented blocks scored highest on routing completeness and checkability. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
d349b93d1d
commit
9d674404c8
10 changed files with 364 additions and 48 deletions
38
.github/skills/encode/SKILL.md
vendored
38
.github/skills/encode/SKILL.md
vendored
|
|
@ -7,7 +7,17 @@ Given a problem description (natural language, pseudocode, or a partial formulat
|
|||
|
||||
# Step 1: Identify the problem class
|
||||
|
||||
Common encodings:
|
||||
Action:
|
||||
Determine the SMT theory and variable sorts required by the problem
|
||||
description.
|
||||
|
||||
Expectation:
|
||||
A clear mapping from the problem to one of the supported theories
|
||||
(LIA, LRA, QF_BV, etc.).
|
||||
|
||||
Result:
|
||||
If the theory is identified, proceed to Step 2. If the problem spans
|
||||
multiple theories, select the appropriate combined logic.
|
||||
|
||||
| Problem class | Theory | Typical sorts |
|
||||
|---------------|--------|---------------|
|
||||
|
|
@ -21,17 +31,35 @@ Common encodings:
|
|||
|
||||
# Step 2: Generate the encoding
|
||||
|
||||
Action:
|
||||
Invoke encode.py with the problem description and desired output format.
|
||||
|
||||
Expectation:
|
||||
The script produces a complete SMT-LIB2 file or Z3 Python script with
|
||||
all declarations, constraints, and check-sat commands.
|
||||
|
||||
Result:
|
||||
For `smtlib2` format: pass the output to **solve**.
|
||||
For `python` format: execute the script directly.
|
||||
Proceed to Step 3 for validation.
|
||||
|
||||
```bash
|
||||
python3 scripts/encode.py --problem "Find integers x, y such that x^2 + y^2 = 25 and x > 0" --format smtlib2
|
||||
python3 scripts/encode.py --problem "Schedule 4 tasks on 2 machines minimizing makespan" --format python
|
||||
```
|
||||
|
||||
For `--format smtlib2`, the output is a complete .smt2 file ready for the **solve** skill.
|
||||
For `--format python`, the output is a standalone Z3 Python script.
|
||||
|
||||
# Step 3: Validate the encoding
|
||||
|
||||
The script checks that the generated formula is syntactically valid by running a quick `z3 -in` parse check (no solving, just syntax). Parse errors are reported with the offending line.
|
||||
Action:
|
||||
The script runs a syntax check by piping the output through `z3 -in`
|
||||
in parse-only mode.
|
||||
|
||||
Expectation:
|
||||
No parse errors. If errors occur, the offending line is reported.
|
||||
|
||||
Result:
|
||||
On success: the encoding is ready for **solve**, **prove**, or **optimize**.
|
||||
On parse error: fix the reported line and re-run.
|
||||
|
||||
# Parameters
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue