2024-10-17 21:28:23 -07:00
|
|
|
# Goals and Tactics
|
|
|
|
|
2024-10-18 15:19:58 -07:00
|
|
|
Executing tactics in Pantograph is very simple. To start a proof, call the
|
|
|
|
`Server.goal_start` function and supply an expression.
|
2024-10-17 21:28:23 -07:00
|
|
|
|
|
|
|
```python
|
|
|
|
from pantograph import Server
|
|
|
|
|
|
|
|
server = Server()
|
|
|
|
state0 = server.goal_start("forall (p q: Prop), Or p q -> Or q p")
|
2024-10-18 15:19:58 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
This creates a *goal state*, which consists of a finite number of goals. In this
|
|
|
|
case since it is the beginning of a state, it has only one goal. `print(state0)` gives
|
|
|
|
|
|
|
|
```
|
|
|
|
GoalState(state_id=0, goals=[Goal(variables=[], target='forall (p : Prop), p -> p', name=None, is_conversion=False)], _sentinel=[])
|
|
|
|
```
|
|
|
|
|
|
|
|
To execute a tactic on a goal state, use `Server.goal_tactic`. This function
|
|
|
|
takes a goal id and a tactic. Most Lean tactics are strings.
|
|
|
|
|
|
|
|
```python
|
2024-10-17 21:28:23 -07:00
|
|
|
state1 = server.goal_tactic(state0, goal_id=0, tactic="intro a")
|
|
|
|
```
|
|
|
|
|