diff --git a/Isabelle_DOF-Unit-Tests/High_Level_Syntax_Invariants.thy b/Isabelle_DOF-Unit-Tests/High_Level_Syntax_Invariants.thy index 220b779f..eb5f373e 100644 --- a/Isabelle_DOF-Unit-Tests/High_Level_Syntax_Invariants.thy +++ b/Isabelle_DOF-Unit-Tests/High_Level_Syntax_Invariants.thy @@ -90,7 +90,7 @@ text\Now assume the following ontology:\ doc_class title = short_title :: "string option" <= "None" -doc_class author = +doc_class Author = email :: "string" <= "''''" datatype classification = SIL0 | SIL1 | SIL2 | SIL3 | SIL4 @@ -100,18 +100,18 @@ doc_class abstract = safety_level :: "classification" <= "SIL3" doc_class text_section = - authored_by :: "author set" <= "{}" + authored_by :: "Author set" <= "{}" level :: "int option" <= "None" type_synonym notion = string -doc_class introduction = text_section + - authored_by :: "author set" <= "UNIV" +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" + and force_level :: "(level \) \ None \ the (level \) > 1" -doc_class claim = introduction + +doc_class claim = Introduction + based_on :: "notion list" doc_class technical = text_section + @@ -140,7 +140,7 @@ text\Next we define some instances (docitems): \ declare[[invariants_checking_with_tactics = true]] -text*[church::author, email="\church@lambda.org\"]\\ +text*[church::Author, email="\church@lambda.org\"]\\ text*[resultProof::result, evidence = "proof", property="[@{thm \HOL.refl\}]"]\\ text*[resultArgument::result, evidence = "argument"]\\ @@ -151,29 +151,30 @@ text\The invariants \<^theory_text>\author_finite\ and \<^the It will enable a basic tactic, using unfold and auto:\ declare[[invariants_checking_with_tactics = true]] -(* -text*[curry::author, email="\curry@lambda.org\"]\\ -text*[introduction2::introduction, authored_by = "{@{author \church\}}", level = "Some 2"]\\ - When not commented, should violated the invariant: -update_instance*[introduction2::introduction - , authored_by := "{@{author \church\}}" + +text*[curry::Author, email="\curry@lambda.org\"]\\ +text*[introduction2::Introduction, authored_by = "{@{Author \church\}}", level = "Some 2"]\\ +(* When not commented, should violated the invariant: +update_instance*[introduction2::Introduction + , authored_by := "{@{Author \church\}}" , level := "Some 1"] +*) -text*[introduction3::introduction, authored_by = "{@{author \church\}}", level = "Some 2"]\\ -text*[introduction4::introduction, authored_by = "{@{author \curry\}}", level = "Some 4"]\\ +text*[introduction3::Introduction, authored_by = "{@{Author \church\}}", level = "Some 2"]\\ +text*[introduction4::Introduction, authored_by = "{@{Author \curry\}}", level = "Some 4"]\\ text*[resultProof2::result, evidence = "proof", property="[@{thm \HOL.sym\}]"]\\ 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\}\ +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*\@{Introduction \introduction2\}\ -value*\{@{author \curry\}} = {@{author \church\}}\ +value*\{@{Author \curry\}} = {@{Author \church\}}\ term*\property @{result \resultProof\} = property @{result \resultProof2\}\ value*\property @{result \resultProof\} = property @{result \resultProof2\}\ @@ -183,5 +184,5 @@ value*\evidence @{result \resultProof\} = evidence @{result \ declare[[invariants_checking_with_tactics = false]] declare[[invariants_strict_checking = false]] -*) + end