Skip to content

Commit 56f0734

Browse files
committed
show tactic
1 parent 49628aa commit 56f0734

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

examples/nng.ipynb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,21 @@
2424
"python3 -m pip install -e ."
2525
]
2626
},
27+
{
28+
"cell_type": "markdown",
29+
"metadata": {},
30+
"source": [
31+
"If the following cell fails after first installation, you may need to restart the notebook runtime"
32+
]
33+
},
2734
{
2835
"cell_type": "code",
29-
"execution_count": 5,
36+
"execution_count": null,
3037
"metadata": {},
3138
"outputs": [],
3239
"source": [
3340
"import kdrag as kd\n",
34-
"import kdrag.smt as smt\n",
41+
"import kdrag.smt as smt # smt is essentially a reexport of z3\n",
3542
"\n",
3643
"#Or for short:\n",
3744
"#from kdrag.all import *"
@@ -820,6 +827,7 @@
820827
"outputs": [],
821828
"source": [
822829
"l = kd.Lemma(smt.ForAll([n,m], n + Nat.Succ(m) == Nat.Succ(n + m)))\n",
830+
"l\n",
823831
"# TODO"
824832
]
825833
},

kdrag/tactics.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,15 @@ def generalize(self, *vs):
553553
self.goals.append(goalctx._replace(goal=smt.ForAll(vs, goalctx.goal)))
554554
return self.top_goal()
555555

556+
def show(self, thm: smt.BoolRef):
557+
"""
558+
To document the current goal
559+
"""
560+
goal = self.top_goal().goal
561+
if not thm.eq(goal):
562+
raise ValueError("Goal does not match", thm, goal)
563+
return self.top_goal()
564+
556565
def assumption(self):
557566
"""
558567
Exact match of goal in the context

0 commit comments

Comments
 (0)