Moved unit tests into tests directory and added test session.

This commit is contained in:
Achim D. Brucker 2019-07-20 14:54:31 +01:00
parent 189110dc0f
commit a85bcacd5b
9 changed files with 51 additions and 24 deletions

8
ROOT
View File

@ -10,3 +10,11 @@ session "Isabelle_DOF" = "Functional-Automata" +
"ontologies/technical_report" "ontologies/technical_report"
"ontologies/mathex_onto" "ontologies/mathex_onto"
session "Isabelle_DOF-tests" = "Isabelle_DOF" +
options [document = false]
theories
"tests/AssnsLemmaThmEtc"
"tests/Concept_ExampleInvariant"
"tests/Concept_Example"
"tests/InnerSyntaxAntiquotations"
"tests/Attributes"

View File

@ -1,5 +1,8 @@
theory AssnsLemmaThmEtc theory
imports "../../ontologies/Conceptual" "../../ontologies/math_paper" AssnsLemmaThmEtc
imports
"../ontologies/Conceptual"
"../ontologies/math_paper"
begin begin
section\<open>Elementary Creation of Doc-items and Access of their Attibutes\<close> section\<open>Elementary Creation of Doc-items and Access of their Attibutes\<close>
@ -17,14 +20,18 @@ text*[aa::F, property = "[@{term ''True''}]"]
\<open>Our definition of the HOL-Logic has the following properties:\<close> \<open>Our definition of the HOL-Logic has the following properties:\<close>
assert*[aa::F] "True" assert*[aa::F] "True"
(* does not work in batch mode ...
(* sample for accessing a property filled with previous assert's of "aa" *) (* sample for accessing a property filled with previous assert's of "aa" *)
ML\<open> ISA_core.property_list_dest @{context} @{docitem_attribute property :: aa};\<close> ML\<open> ISA_core.property_list_dest @{context} @{docitem_attribute property :: aa};\<close>
assert*[aa::F] " X \<and> Y \<longrightarrow> True" (*example with uni-code *) assert*[aa::F] " X \<and> Y \<longrightarrow> True" (*example with uni-code *)
ML\<open> ISA_core.property_list_dest @{context} @{docitem_attribute property :: aa}; ML\<open> ISA_core.property_list_dest @{context} @{docitem_attribute property :: aa};
app writeln (tl (rev it));\<close> app writeln (tl (rev it));\<close>
*)
assert*[aa::F] "\<forall>x::bool. X \<and> Y \<longrightarrow> True" (*problem with uni-code *) assert*[aa::F] "\<forall>x::bool. X \<and> Y \<longrightarrow> True" (*problem with uni-code *)
ML\<open> ML\<open>
@ -33,12 +40,12 @@ Syntax.read_term_global @{theory} "[@{termrepr ''True @<longrightarrow> True''}]
@{term "[@{term '' True @<longrightarrow> True ''}]"}; (* with isa-check *) @{term "[@{term '' True @<longrightarrow> True ''}]"}; (* with isa-check *)
@{term "[@{termrepr '' True @<longrightarrow> True ''}]"}; (* without isa check *) @{term "[@{termrepr '' True @<longrightarrow> True ''}]"}; (* without isa check *)
\<close> \<close>
(*
ML\<open>val [_,_,Const _ $ s,_] = (HOLogic.dest_list @{docitem_attribute property :: aa}); ML\<open>val [_,_,Const _ $ s,_] = (HOLogic.dest_list @{docitem_attribute property :: aa});
val t = HOLogic.dest_string s; val t = HOLogic.dest_string s;
holstring_to_bstring @{context} t holstring_to_bstring @{context} t
\<close> \<close>
*)
lemma "All (\<lambda>x. X \<and> Y \<longrightarrow> True)" oops lemma "All (\<lambda>x. X \<and> Y \<longrightarrow> True)" oops

View File

@ -1,5 +1,7 @@
theory Attributes theory
imports "../../ontologies/Conceptual" Attributes
imports
"../ontologies/Conceptual"
begin begin
section\<open>Elementary Creation of Doc-items and Access of their Attibutes\<close> section\<open>Elementary Creation of Doc-items and Access of their Attibutes\<close>
@ -18,7 +20,10 @@ Symtab.dest docclass_tab;
text\<open>A text item containing standard theorem antiquotations and complex meta-information.\<close> text\<open>A text item containing standard theorem antiquotations and complex meta-information.\<close>
text*[dfgdfg::B, Conceptual.B.x ="''f''", y = "[''sdf'']"]\<open> Lorem ipsum ... @{thm refl} \<close> (* crashes in batch mode ...
text*[dfgdfg::B, Conceptual.B.x ="''f''", y = "[''sdf'']"]\<open> Lorem ipsum ... @{thm refl} \<close>
*)
text*[dfgdfg::B]\<open> Lorem ipsum ... @{thm refl} \<close>
text\<open>document class declarations lead also HOL-type declarations (relevant for ontological links).\<close> text\<open>document class declarations lead also HOL-type declarations (relevant for ontological links).\<close>
typ "C" typ "C"
@ -106,7 +111,6 @@ text\<open> @{docitem_attribute omega::y} \<close>
section\<open>Simulation of a Monitor\<close> section\<open>Simulation of a Monitor\<close>
open_monitor*[figs1::figure_group, open_monitor*[figs1::figure_group,
(* anchor="''fig-demo''", ? ? ? apparently eliminated by Achim *)
caption="''Sample ''"] caption="''Sample ''"]
figure*[fig_A::figure, spawn_columns=False, figure*[fig_A::figure, spawn_columns=False,
@ -130,6 +134,6 @@ text\<open>@{trace_attribute figs1}\<close>
text\<open>Final Status:\<close> text\<open>Final Status:\<close>
print_doc_items print_doc_items
print_doc_classes print_doc_classes
check_doc_global
end end
(*>*) (*>*)

View File

@ -1,10 +1,12 @@
chapter\<open>Setting and modifying attributes of doc-items\<close> chapter\<open>Setting and modifying attributes of doc-items\<close>
theory Concept_Example theory
imports "../../ontologies/Conceptual" (* we use the generic "Conceptual" ontology *) Concept_Example
imports
"../ontologies/Conceptual" (* we use the generic "Conceptual" ontology *)
begin begin
text\<open>@{theory Draft.Conceptual} provides a monitor @{typ M} enforcing a particular document structure. text\<open>@{theory "Isabelle_DOF-tests.Conceptual"} provides a monitor @{typ M} enforcing a particular document structure.
Here, we say: From now on, this structural rules are respected wrt. all doc\_classes M is Here, we say: From now on, this structural rules are respected wrt. all doc\_classes M is
enabled for.\<close> enabled for.\<close>
open_monitor*[struct::M] open_monitor*[struct::M]
@ -29,7 +31,7 @@ fancy unicode such as: @{term "\<open>\<beta>\<^sub>i''\<close>"} \<close>
text*[f::F] \<open> Lectus accumsan velit ultrices, ... }\<close> text*[f::F] \<open> Lectus accumsan velit ultrices, ... }\<close>
theorem some_proof : "P" sorry theorem some_proof : "True" by simp
text\<open>This is an example where we add a theorem into a kind of "result-list" of the doc-item f.\<close> text\<open>This is an example where we add a theorem into a kind of "result-list" of the doc-item f.\<close>
update_instance*[f::F,r:="[@{thm ''Concept_Example.some_proof''}]"] update_instance*[f::F,r:="[@{thm ''Concept_Example.some_proof''}]"]
@ -52,4 +54,4 @@ print_doc_items
end end

View File

@ -1,7 +1,9 @@
chapter\<open>Setting and modifying attributes of doc-items\<close> chapter\<open>Setting and modifying attributes of doc-items\<close>
theory Concept_ExampleInvariant theory
imports "../../ontologies/Conceptual" (* we use the generic "Conceptual" ontology *) Concept_ExampleInvariant
imports
"../ontologies/Conceptual" (* we use the generic "Conceptual" ontology *)
begin begin
section\<open>Example: Standard Class Invariant\<close> section\<open>Example: Standard Class Invariant\<close>
@ -108,4 +110,4 @@ close_monitor*[struct]
end end

View File

@ -1,7 +1,9 @@
chapter\<open>Inner Syntax Antiquotations (ISA)'s\<close> chapter\<open>Inner Syntax Antiquotations (ISA)'s\<close>
theory InnerSyntaxAntiquotations theory
imports "../../ontologies/Conceptual" InnerSyntaxAntiquotations
imports
"../ontologies/Conceptual"
begin begin
text\<open>Since the syntax chosen for values of doc-class attributes is HOL-syntax --- requiring text\<open>Since the syntax chosen for values of doc-class attributes is HOL-syntax --- requiring
@ -14,7 +16,7 @@ They are the key-mechanism to denote
\<^item> Ontological Links, i.e. attributes refering to document classes defined by the ontology \<^item> Ontological Links, i.e. attributes refering to document classes defined by the ontology
\<^item> Ontological F-Links, i.e. attributes referring to formal entities inside Isabelle (such as thm's) \<^item> Ontological F-Links, i.e. attributes referring to formal entities inside Isabelle (such as thm's)
This file contains a number of examples resulting from the @{theory "Draft.Conceptual"} - ontology; This file contains a number of examples resulting from the @{theory "Isabelle_DOF-tests.Conceptual"} - ontology;
the emphasis of this presentation is to present the expressivity of ODL on a paradigmatical example. the emphasis of this presentation is to present the expressivity of ODL on a paradigmatical example.
\<close> \<close>
@ -26,11 +28,13 @@ val {docobj_tab={tab = x, ...},docclass_tab, ISA_transformer_tab,...} = DOF_core
\<close> \<close>
text\<open>Some sample lemma:\<close> text\<open>Some sample lemma:\<close>
lemma murks : "Example" sorry lemma murks : "Example=Example" by simp
text\<open>Example for a meta-attribute of ODL-type @{typ "file"} with an appropriate ISA for the text\<open>Example for a meta-attribute of ODL-type @{typ "file"} with an appropriate ISA for the
file @{file "./Attributes.thy"}\<close> file @{file "InnerSyntaxAntiquotations.thy"}\<close>
text*[xcv::F, u="@{file ''./examples/conceptual/Attributes.thy''}"]\<open>Lorem ipsum ...\<close> (* not working:
text*[xcv::F, u="@{file ''InnerSyntaxAntiquotations.thy''}"]\<open>Lorem ipsum ...\<close>
*)
text*[xcv1::A, x=5]\<open>Lorem ipsum ...\<close> text*[xcv1::A, x=5]\<open>Lorem ipsum ...\<close>
text*[xcv3::A, x=7]\<open>Lorem ipsum ...\<close> text*[xcv3::A, x=7]\<open>Lorem ipsum ...\<close>

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB