From def15c3748599d5c05cae164653e85ea03da6be6 Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Wed, 30 Jan 2019 16:38:38 +0100 Subject: Clean and comment methods file --- HoTT_Methods.thy | 75 +++++++++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/HoTT_Methods.thy b/HoTT_Methods.thy index f0cee6c..99f3446 100644 --- a/HoTT_Methods.thy +++ b/HoTT_Methods.thy @@ -1,80 +1,73 @@ -(* -Title: HoTT_Methods.thy -Author: Joshua Chen -Date: 2018 +(******** +Isabelle/HoTT: Proof methods +Jan 2019 -Method setup for the HoTT logic. -*) +********) theory HoTT_Methods imports HoTT_Base "HOL-Eisbach.Eisbach" "HOL-Eisbach.Eisbach_Tools" begin +section \Substitution and simplification\ -section \Handling universes\ +ML_file "~~/src/Tools/misc_legacy.ML" +ML_file "~~/src/Tools/IsaPlanner/isand.ML" +ML_file "~~/src/Tools/IsaPlanner/rw_inst.ML" +ML_file "~~/src/Tools/IsaPlanner/zipper.ML" +ML_file "~~/src/Tools/eqsubst.ML" +\ \Import the @{method subst} method, used for substituting definitional equalities.\ -method provelt = (rule lt_Suc | (rule lt_trans, (rule lt_Suc)+)+) +text \ +Method @{theory_text compute} performs single-step simplifications, using any rules declared @{attribute comp} in the context. +Premises of the rule(s) applied are added as new subgoals. +\ -method hierarchy = (rule U_hierarchy, provelt) +method compute declares comp = (subst comp) -method cumulativity declares form = ( - ((elim U_cumulative' | (rule U_cumulative', rule form)), rule leq_min) | - ((elim U_cumulative | (rule U_cumulative, rule form)), provelt) -) +section \Handling universes\ text \ -Methods @{method provelt}, @{method hierarchy}, and @{method cumulativity} prove statements of the form +Methods @{theory_text provelt}, @{theory_text hierarchy}, and @{theory_text cumulativity} prove propositions of the form + \<^item> \n < (Suc (... (Suc n) ...))\, \<^item> \U i: U (Suc (... (Suc i) ...))\, and -\<^item> @{prop "A: U i \ A: U j"}, where @{prop "i \ j"} -respectively. -\ - - -section \Deriving typing judgments\ +\<^item> @{prop "A: U i \ A: U j"}, where @{prop "i \ j"}, -method routine uses add = (assumption | rule add | rule)+ - -text \ -The method @{method routine} proves type judgments @{prop "a : A"} using the rules declared @{attribute intro} in the respective theory files, as well as additional provided lemmas passed using the modifier \add\. +respectively. \ +method provelt = (rule lt_Suc | (rule lt_trans, (rule lt_Suc)+)+) -section \Substitution and simplification\ +method hierarchy = (rule U_hierarchy, provelt) -ML_file "~~/src/Tools/misc_legacy.ML" -ML_file "~~/src/Tools/IsaPlanner/isand.ML" -ML_file "~~/src/Tools/IsaPlanner/rw_inst.ML" -ML_file "~~/src/Tools/IsaPlanner/zipper.ML" -ML_file "~~/src/Tools/eqsubst.ML" +method cumulativity declares form = ( + ((elim U_cumulative' | (rule U_cumulative', rule form)), rule leq_min) | + ((elim U_cumulative | (rule U_cumulative, rule form)), provelt) +) -\ \Import the @{method subst} method, used for substituting definitional equalities.\ +section \Deriving typing judgments\ -method compute declares comp = (subst comp) +method routine uses add = (assumption | rule add | rule)+ text \ -Method @{method compute} performs single-step simplifications, using any rules declared @{attribute comp} in the context. -Premises of the rule(s) applied are added as new subgoals. +The method @{method routine} proves typing judgments @{prop "a: A"} using the rules declared @{attribute intro} in the respective theory files, as well as any additional lemmas provided with the modifier @{theory_text add}. \ - section \Derivation search\ text \ -Combine @{method routine} and @{method compute} to search for derivations of judgments. -Also handle universes using @{method hierarchy} and @{method cumulativity}. +The method @{theory_text derive} combines @{method routine} and @{method compute} to search for derivations of judgments. +It also handles universes using @{method hierarchy} and @{method cumulativity}. \ method derive uses lems = (routine add: lems | compute comp: lems | cumulativity form: lems | hierarchy)+ - section \Induction\ text \ -Placeholder section for the automation of induction, i.e. using the elimination rules. -At the moment one must directly apply them with \rule X_elim\. +Placeholder section for the automation of induction, i.e. using the type elimination rules. +At the moment one must directly apply them with @{method rule} or @{method elim}. \ - end -- cgit v1.2.3