Skip to content

Commit ce57f27

Browse files
authored
feat: extract_from_and tactic (#63)
1 parent c85970f commit ce57f27

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

SP1Foundations.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ import SP1Foundations.Opcode
88
import SP1Foundations.Register
99
import SP1Foundations.SP1State
1010
import SP1Foundations.SailM
11+
import SP1Foundations.Tactics
1112
import SP1Foundations.Unsigned
1213
import SP1Foundations.Word

SP1Foundations/Tactics.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Lean
2+
3+
open Lean
4+
5+
/-- Recursively extract a goal from nested conjunctions in the context.
6+
Splits ANDs and tries exact on each branch, recursing if needed. -/
7+
syntax "extract_from_and" ident : tactic
8+
9+
macro_rules
10+
| `(tactic| extract_from_and $h:ident) => `(tactic|
11+
first
12+
| exact $h
13+
| (obtain ⟨h_left, h_right⟩ := $h
14+
first
15+
| exact h_left
16+
| exact h_right
17+
| extract_from_and h_left
18+
| extract_from_and h_right)
19+
)

0 commit comments

Comments
 (0)