solve
Execute Z3 Python code to solve SMT constraints and check satisfiability of logical formulas.
Instructions
Execute Z3 Python code to solve SMT constraints.
The code can use any Z3 Python API functions. Common imports (Solver, Int, Real, Bool, And, Or, Not, etc.) are pre-loaded.
Example:
x = Int('x')
y = Int('y')
solver = Solver()
solver.add(x + y == 10)
solver.add(x - y == 4)
if solver.check() == sat:
print(solver.model())Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "solve"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Z3 Python code to execute | |
| timeout_ms | No | Timeout in milliseconds (default: 30000) |