diff --git a/src/tests/High_Level_Syntax_Invariants.thy b/src/tests/High_Level_Syntax_Invariants.thy index 805cc59..5063220 100644 --- a/src/tests/High_Level_Syntax_Invariants.thy +++ b/src/tests/High_Level_Syntax_Invariants.thy @@ -66,6 +66,7 @@ doc_class introduction = text_section + authored_by :: "author set" <= "UNIV" uses :: "notion set" invariant author_finite :: "finite (authored_by \)" + and force_level :: "the (level \) > 1" doc_class claim = introduction + based_on :: "notion list" @@ -83,32 +84,54 @@ doc_class result = technical + evidence :: kind property :: "thm list" <= "[]" invariant has_property :: "evidence \ = proof \ property \ \ []" + doc_class example = technical + referring_to :: "(notion + definition) set" <= "{}" doc_class conclusion = text_section + establish :: "(claim \ result) set" - invariant total_rel :: "\ x. x \ Domain (establish \) - \ (\ y \ Range (establish \). (x, y) \ establish \)" + invariant establish_defined :: "\ x. x \ Domain (establish \) + \ (\ y \ Range (establish \). (x, y) \ establish \)" text\Next we define some instances (docitems): \ + +declare[[invariants_checking_with_tactics = true]] + text*[church::author, email="\church@lambda.org\"]\\ +(*text*[introduction1::introduction, authored_by = "{@{author \church\}}", level = "Some 0"]\\*) text*[resultProof::result, evidence = "proof", property="[@{thm \HOL.refl\}]"]\\ text*[resultArgument::result, evidence = "argument"]\\ -text\The invariants \author_finite\ and \total_rel\ can not be checked directly +text\The invariants \<^theory_text>\author_finite\ and \<^theory_text>\establish_defined\ can not be checked directly and need a little help. We can set the \invariants_checking_with_tactics\ theory attribute to help the checking. It will enable a basic tactic, using unfold and auto:\ declare[[invariants_checking_with_tactics = true]] -text*[introductionTest::introduction, authored_by = "{@{author \church\}}"]\\ +text*[curry::author, email="\curry@lambda.org\"]\\ +text*[introduction2::introduction, authored_by = "{@{author \church\}}", level = "Some 2"]\\ +text*[introduction3::introduction, authored_by = "{@{author \church\}}", level = "Some 2"]\\ +text*[introduction4::introduction, authored_by = "{@{author \curry\}}", level = "Some 4"]\\ -text*[claimNotion::claim, authored_by = "{@{author \church\}}", based_on= "[\Notion1\, \Notion2\]"]\\ +text*[resultProof2::result, evidence = "proof", property="[@{thm \HOL.sym\}]"]\\ -text*[conclusionProof::conclusion, - establish = "{(@{claim \claimNotion\}, @{result \resultProof\})}"]\\ +text\Then we can evaluate expressions with instances:\ + +term*\authored_by @{introduction \introduction2\} = authored_by @{introduction \introduction3\}\ +value*\authored_by @{introduction \introduction2\} = authored_by @{introduction \introduction3\}\ +value*\authored_by @{introduction \introduction2\} = authored_by @{introduction \introduction4\}\ + +value*\@{introduction \introduction2\}\ + +value*\{@{author \curry\}} = {@{author \church\}}\ + +term*\property @{result \resultProof\} = property @{result \resultProof2\}\ +value*\property @{result \resultProof\} = property @{result \resultProof2\}\ + +value*\evidence @{result \resultProof\} = evidence @{result \resultProof2\}\ + +declare[[invariants_checking_with_tactics = false]] end