diff --git a/examples/scholarly_paper/2021-ITP-PMTI/paper.thy b/examples/scholarly_paper/2021-ITP-PMTI/paper.thy index 940cdb7c..70949c42 100644 --- a/examples/scholarly_paper/2021-ITP-PMTI/paper.thy +++ b/examples/scholarly_paper/2021-ITP-PMTI/paper.thy @@ -92,8 +92,7 @@ text*[nic::author, text*[bu::author, email ="\wolff@universite-paris-saclay.fr\", affiliation = "\LMF, Université Paris-Saclay, Paris, France\"]\Burkhart Wolff\ - - + text*[abs::abstract, keywordlist="[\Ontologies\,\Formal Documents\,\Formal Development\,\Isabelle/HOL\,\Ontology Mapping\]"] \ \<^dof> is a novel ontology framework on top of Isabelle @{cite "brucker.ea:isabelledof:2019" and "brucker.ea:isabelle-ontologies:2018"}. @@ -168,11 +167,9 @@ proofs, text-elements, etc., prevailing in the Isabelle system framework. In more detail, \<^dof> introduces a number of ``ontology aware'' text-elements with analogous syntax to standard ones. The difference is a bracket with meta-data of the form: @{theory_text [display,indent=5, margin=70] -\ -text*[label::classid, attr\<^sub>1=E\<^sub>1, ... attr\<^sub>n=E\<^sub>n]\ some semi-formal text \ +\text*[label::classid, attr\<^sub>1=E\<^sub>1, ... attr\<^sub>n=E\<^sub>n]\ some semi-formal text \ ML*[label::classid, attr\<^sub>1=E\<^sub>1, ... attr\<^sub>n=E\<^sub>n]\ some SML code \ -... -\} +...\} In these \<^dof> elements, a meta-data object is created and associated to it. This meta-data can be referenced via its label and used in further computations in text or code. %; the details will be explained in the subsequent section. @@ -187,15 +184,12 @@ called \<^emph>\antiquotation\ that depends on the logical context With standard Isabelle antiquotations, for example, the following text element of the integrated source will appear in Isabelle/PIDE as follows: @{theory_text [display,indent=5, margin=70] -\ -text\ According to the reflexivity axiom @{thm refl}, we obtain in \ - for @{term "fac 5"} the result @{value "fac 5"}.\ -\} +\text\ According to the reflexivity axiom @{thm refl}, we obtain in \ + for @{term "fac 5"} the result @{value "fac 5"}.\\} In the corresponding generated \<^LaTeX> or HTML output, this looks like this: -@{theory_text [display,indent=5, margin=70] \ -According to the reflexivity axiom \x = x\, -we obtain in \ for \fac 5\ the result \120\. -\} +@{theory_text [display,indent=5, margin=70] +\According to the reflexivity axiom \x = x\, +we obtain in \ for \fac 5\ the result \120\.\} where the meta-texts \@{thm refl}\ (``give the presentation of theorem `refl'\,\!''), \@{term "fac 5"}\ (``parse and type-check `fac 5' in the previous logical context'') and \@{value "fac 5"}\ (``compile and execute `fac 5' according to its @@ -241,10 +235,9 @@ text\As novel contribution, this work extends prior versions of \<^dof> by common \<^hol> \\\-term syntax. \ text\ For example, the \<^dof> evaluation command taking a \<^hol>-expression: -@{theory_text [display,indent=5, margin=70] \ -value*[ass::Assertion, relvce=2::int] - \filter (\ \. relvce \ > 2) @{Assertion-instances}\ -\} +@{theory_text [display,indent=5, margin=70] +\value*[ass::Assertion, relvce=2::int] + \filter (\ \. relvce \ > 2) @{Assertion-instances}\\} where \<^dof> command \value*\ type-checks, expands in an own validation phase the \Assertion-instances\-term antiquotation, and evaluates the resulting \<^hol> expression above. Assuming an ontology providing the class \Assertion\ having at least the @@ -342,11 +335,9 @@ text\ basic concept of requirements from CENELEC 50128~@{cite "bsi:50128:2014"} is captured in ODL as follows: @{theory_text [display,indent=5, margin=70] -\ -doc_class requirement = text_element + (* derived from text_element *) +\doc_class requirement = text_element + (* derived from text_element *) long_name ::"string option" (* an optional string attribute *) - is_concerned::"role set" (* roles working with this req. *) -\} + is_concerned::"role set" (* roles working with this req. *)\} This ODL class definition maybe part of one or more Isabelle theory--files capturing the entire ontology definition. Isabelle's session management allows for pre-compiling them before being imported in the actual target documentation required to be compliant to this ontology. @@ -554,8 +545,8 @@ text\ If we take back the example ontology for mathematical papers of~@{cite "brucker.ea:isabelledof:2019"} shown in \autoref{fig-ontology-example} \begin{figure} -@{boxed_theory_text [display] \ -doc_class myauthor = +@{boxed_theory_text [display] +\doc_class myauthor = email :: "string" <= "''''" doc_class mytext_section = authored_by :: "myauthor set" <= "{}" @@ -579,16 +570,15 @@ doc_class myresult = mytechnical + doc_class myconclusion = text_section + establish :: "(myclaim \ myresult) set" invariant establish_defined :: "\ x. x \ Domain (establish \) - \ (\ y \ Range (establish \). (x, y) \ establish \)" -\} + \ (\ y \ Range (establish \). (x, y) \ establish \)"\} \caption{Excerpt of an example ontology for mathematical papers.} \label{fig-ontology-example} \end{figure} we can define some class instances for this ontology with the \<^theory_text>\text*\ command, as in \autoref{fig-instances-example}. \begin{figure} -@{boxed_theory_text [display] \ -text*[church::myauthor, email="\church@lambda.org\"]\\ +@{boxed_theory_text [display] +\text*[church::myauthor, email="\church@lambda.org\"]\\ text*[resultProof::myresult, evidence = "proof", property="[@{thm \HOL.refl\}]"]\\ @@ -597,8 +587,7 @@ text*[resultProof2::myresult, evidence = "proof", property="[@{thm \HOL.sy text*[introduction1::myintroduction, authored_by = "{@{myauthor \church\}}", level = "Some 0"]\\ text*[introduction2::myintroduction, authored_by = "{@{myauthor \church\}}", level = "Some 2"]\\ -text*[claimNotion::myclaim, authored_by = "{@{myauthor \church\}}", based_on= "[\Notion1\, \Notion2\]", level = "Some 0"]\\ -\} +text*[claimNotion::myclaim, authored_by = "{@{myauthor \church\}}", based_on= "[\Notion1\, \Notion2\]", level = "Some 0"]\\\} \caption{Some instances of the classes of the ontology of \autoref{fig-ontology-example}.} \label{fig-instances-example} \end{figure} @@ -782,21 +771,18 @@ text\ Thus, to get the list of the properties of the instances of the class \<^typ>\myresult\, or to get the list of the authors of the instances of the \<^typ>\myintroduction\ class, it suffices to treat this meta-data as usual: - @{theory_text [display,indent=5, margin=70] \ -value*\map (myresult.property) @{myresult-instances}\ -value*\map (mytext_section.authored_by) @{myintroduction-instances}\ - \} + @{theory_text [display,indent=5, margin=70] +\value*\map (myresult.property) @{myresult-instances}\ +value*\map (mytext_section.authored_by) @{myintroduction-instances}\\} In order to get the list of the instances of the class \<^typ>\myresult\ whose \<^const>\evidence\ is a \<^const>\proof\, one can use the command: - @{theory_text [display,indent=5, margin=70] \ -value*\filter (\\. myresult.evidence \ = proof) @{myresult-instances}\ - \} + @{theory_text [display,indent=5, margin=70] +\value*\filter (\\. myresult.evidence \ = proof) @{myresult-instances}\\} Analogously, the list of the instances of the class \<^typ>\myintroduction\ whose \<^const>\level\ > 1, can be filtered by: - @{theory_text [display,indent=5, margin=70] \ -value*\filter (\\. the (mytext_section.level \) > 1) - @{myintroduction-instances}\ - \} + @{theory_text [display,indent=5, margin=70] +\value*\filter (\\. the (mytext_section.level \) > 1) + @{myintroduction-instances}\\} \ section*["morphisms"::technical,main_author="Some(@{docitem ''idir''}::author)"] \Proving Morphisms on Ontologies\ @@ -925,8 +911,8 @@ This raises the question of invariant preservation. text\ \begin{figure} -@{boxed_theory_text [display] \ -definition sum +@{boxed_theory_text [display] +\definition sum where "sum S = (fold (+) S 0)" datatype Hardware_Type = @@ -962,8 +948,7 @@ onto_class Hardware = Informatic + invariant c1 :: "mass \ = sum(map Component.mass (composed_of \))" onto_class R_Software = Informatic + - version :: int -\} + version :: int\} \caption{An extract of a reference ontology.} \label{fig-Reference-Ontology-example} \end{figure} @@ -984,8 +969,8 @@ with the masses of its own components. text\ \begin{figure} -@{boxed_theory_text [display] \ -onto_class Item = +@{boxed_theory_text [display] +\onto_class Item = name :: string onto_class Product = Item + @@ -1002,8 +987,7 @@ onto_class Electronic_Component = Product + onto_class Computer_Hardware = Product + type :: Hardware_Type composed_of :: "Product list" - invariant c2 :: "Product.mass \ = sum(map Product.mass (composed_of \))" -\} + invariant c2 :: "Product.mass \ = sum(map Product.mass (composed_of \))"\} \caption{An extract of a local (user) ontology.} \label{fig-Local-Ontology-example} \end{figure} @@ -1021,9 +1005,8 @@ equals the sum of all the masses of the products composing the object. text\ \begin{figure} -@{boxed_theory_text [display] \ - -definition Item_to_Resource_morphism :: "'a Item_scheme \ Resource" +@{boxed_theory_text [display] +\definition Item_to_Resource_morphism :: "'a Item_scheme \ Resource" ("_ \Resource\\<^sub>I\<^sub>t\<^sub>e\<^sub>m" [1000]999) where "\ \Resource\\<^sub>I\<^sub>t\<^sub>e\<^sub>m = \ Resource.tag_attribute = 0::int , Resource.name = name \ \" @@ -1048,8 +1031,7 @@ definition Computer_Hardware_to_Hardware_morphism :: Hardware.mass = mass \ , Hardware.composed_of = map Product_to_Component_morphism - (Computer_Hardware.composed_of \) \" -\} + (Computer_Hardware.composed_of \) \"\} \caption{An extract of a mapping definitions.} \label{fig-mapping-example} \end{figure} @@ -1076,8 +1058,8 @@ of invariants, as we will demonstrate in the following example.\ text\ \begin{figure} -@{boxed_theory_text [display] \ -lemma inv_c2_preserved : +@{boxed_theory_text [display] +\lemma inv_c2_preserved : "c2_inv \ \ c1_inv (\ \Hardware\\<^sub>C\<^sub>o\<^sub>m\<^sub>p\<^sub>u\<^sub>t\<^sub>e\<^sub>r\<^sub>H\<^sub>a\<^sub>r\<^sub>d\<^sub>w\<^sub>a\<^sub>r\<^sub>e)" unfolding c1_inv_def c2_inv_def Computer_Hardware_to_Hardware_morphism_def @@ -1087,8 +1069,7 @@ lemma inv_c2_preserved : lemma Computer_Hardware_to_Hardware_morphism_total : "Computer_Hardware_to_Hardware_morphism ` ({X::Computer_Hardware. c2_inv X}) \ ({X::Hardware. c1_inv X})" - using inv_c2_preserved by auto -\} + using inv_c2_preserved by auto\} \caption{Proofs establishing the Invariant Preservation.} \label{fig-xxx} \end{figure} @@ -1098,7 +1079,7 @@ meta-data into another format along an ontological mapping are nearly trivial: a the invariant and the morphism definitions, the preservation proof is automatic. \ - +(* section*[ontoexample::text_section,main_author="Some(@{docitem ''idir''}::author)"] \Mathematics Example : An Extract from OntoMath\textsuperscript{PRO}\ @@ -1263,6 +1244,7 @@ onto_class assoc_Method_Problem = and thus can help to find the right trade-off between plain vocabularies and highly formalized models. \ +*) section*[concl::conclusion]\Conclusion\ text\We presented \<^dof>, an ontology framework