From 5e18f1964efca8e73c3bda1967803b6b85feb27c Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Mon, 25 May 2020 16:26:53 +0200 Subject: `refl` and `this` methods --- spartan/theories/Spartan.thy | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'spartan') diff --git a/spartan/theories/Spartan.thy b/spartan/theories/Spartan.thy index 744e219..d235041 100644 --- a/spartan/theories/Spartan.thy +++ b/spartan/theories/Spartan.thy @@ -149,7 +149,7 @@ ML_file \../lib/focus.ML\ section \Congruence automation\ -(*Work in progress*) +(*Potential to be retired*) ML_file \../lib/congruence.ML\ @@ -206,6 +206,20 @@ method_setup dest = >> (fn (opt_n, ths) => fn ctxt => SIMPLE_METHOD (HEADGOAL (SIDE_CONDS (dest_tac opt_n ths ctxt) ctxt)))\ +subsection \Reflexivity\ + +named_theorems refl +method refl = (rule refl) + +subsection \Trivial proofs modulo typechecking\ + +method_setup this = + \Scan.succeed (fn ctxt => METHOD ( + EVERY o map (HEADGOAL o + (fn ths => SIDE_CONDS (resolve_tac ctxt ths) ctxt) o + single) + ))\ + subsection \Rewriting\ \ \\subst\ method\ @@ -234,18 +248,16 @@ lemma imp_cong_eq: "(PROP A \ (PROP B \ PROP C) \ (PROP B' \ PROP C')) \ ((PROP B \ PROP A \ PROP C) \ (PROP B' \ PROP A \ PROP C'))" apply (Pure.intro Pure.equal_intr_rule) - apply (drule (1) cut_rl; drule Pure.equal_elim_rule1 Pure.equal_elim_rule2; assumption)+ - apply (drule Pure.equal_elim_rule1 Pure.equal_elim_rule2; assumption)+ + apply (drule (1) cut_rl; drule Pure.equal_elim_rule1 Pure.equal_elim_rule2; + assumption)+ + apply (drule Pure.equal_elim_rule1 Pure.equal_elim_rule2; assumption)+ done ML_file \~~/src/HOL/Library/cconv.ML\ ML_file \../lib/rewrite.ML\ -\ \\reduce\ method computes terms via judgmental equalities\ -setup \ - map_theory_simpset (fn ctxt => - ctxt addSolver (mk_solver "" typechk_tac)) -\ +\ \\reduce\ computes terms via judgmental equalities\ +setup \map_theory_simpset (fn ctxt => ctxt addSolver (mk_solver "" typechk_tac))\ method reduce uses add = (simp add: comps add | subst comps)+ -- cgit v1.2.3