diff options
author | Josh Chen | 2020-07-21 02:16:14 +0200 |
---|---|---|
committer | GitHub | 2020-07-21 02:16:14 +0200 |
commit | dfd241b2d85fc5a4ad4d7ddd64adf0138b05f083 (patch) | |
tree | b4c4280b1bc4426059ddd184a2258d15d20a0bab /spartan/core/eqsubst.ML | |
parent | 6aaf4d5b28a5284b3b02fa5c410d2d83a711840b (diff) | |
parent | 12eed8685674b7d5ff7bc45a44a061e01f99ce5f (diff) |
Merge pull request #8 from jaycech3n/dev
Merge big diff on dev
Diffstat (limited to 'spartan/core/eqsubst.ML')
-rw-r--r-- | spartan/core/eqsubst.ML | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/spartan/core/eqsubst.ML b/spartan/core/eqsubst.ML index ea6f098..e7ecf63 100644 --- a/spartan/core/eqsubst.ML +++ b/spartan/core/eqsubst.ML @@ -416,19 +416,27 @@ fun eqsubst_asm_tac ctxt occs thms i st = should be done to an assumption, false = apply to the conclusion of the goal) as well as the theorems to use *) val _ = - Theory.setup - (Method.setup \<^binding>\<open>sub\<close> - (Scan.lift (Args.mode "asm" -- Scan.optional (Args.parens (Scan.repeat Parse.nat)) [0]) -- - Attrib.thms >> (fn ((asm, occs), inthms) => fn ctxt => - SIMPLE_METHOD' ((if asm then eqsubst_asm_tac else eqsubst_tac) ctxt occs inthms))) - "single-step substitution" - #> - (Method.setup \<^binding>\<open>subst\<close> - (Scan.lift (Args.mode "asm" -- Scan.optional (Args.parens (Scan.repeat Parse.nat)) [0]) -- - Attrib.thms >> (fn ((asm, occs), inthms) => fn ctxt => - SIMPLE_METHOD' (SIDE_CONDS - ((if asm then eqsubst_asm_tac else eqsubst_tac) ctxt occs inthms) - ctxt))) - "single-step substitution with auto-typechecking")) + let + val parser = + Scan.lift (Args.mode "asm" + -- Scan.optional (Args.parens (Scan.repeat Parse.nat)) [0]) + -- Attrib.thms + fun eqsubst_asm_ctac occs inthms = + CONTEXT_TACTIC' (fn ctxt => eqsubst_asm_tac ctxt occs inthms) + fun eqsubst_ctac occs inthms = + CONTEXT_TACTIC' (fn ctxt => eqsubst_tac ctxt occs inthms) + in + Theory.setup ( + Method.setup \<^binding>\<open>sub\<close> + (parser >> (fn ((asm, occs), inthms) => fn ctxt => SIMPLE_METHOD' ( + (if asm then eqsubst_asm_tac else eqsubst_tac) ctxt occs inthms))) + "single-step substitution" #> + Method.setup \<^binding>\<open>subst\<close> + (parser >> (fn ((asm, occs), inthms) => K (CONTEXT_METHOD ( + CHEADGOAL o SIDE_CONDS + ((if asm then eqsubst_asm_ctac else eqsubst_ctac) occs inthms))))) + "single-step substitution with automatic discharge of side conditions" + ) + end end; |