diff --git a/examples/scholarly_paper/2018-cicm-isabelle_dof-applications/IsaDofApplications.thy b/examples/scholarly_paper/2018-cicm-isabelle_dof-applications/IsaDofApplications.thy index 6d235ea..9e5772d 100755 --- a/examples/scholarly_paper/2018-cicm-isabelle_dof-applications/IsaDofApplications.thy +++ b/examples/scholarly_paper/2018-cicm-isabelle_dof-applications/IsaDofApplications.thy @@ -26,8 +26,7 @@ define_shortcut* isadof \ \\isadof\ Protege \ \Prot{\'e}g{\'e}\ (* slanted text in contrast to italics *) -setup\ DOF_lib.define_macro \<^binding>\slanted_text\ "\\textsl{" "}" (K(K()))\ - +define_macro* slanted_text \ \\textsl{\ \}\ (*>*) diff --git a/examples/scholarly_paper/2020-iFM-CSP/paper.thy b/examples/scholarly_paper/2020-iFM-CSP/paper.thy index c8cb060..2d4e2d1 100644 --- a/examples/scholarly_paper/2020-iFM-CSP/paper.thy +++ b/examples/scholarly_paper/2020-iFM-CSP/paper.thy @@ -1,18 +1,18 @@ (*<*) theory "paper" - imports - "Isabelle_DOF.scholarly_paper" + imports "Isabelle_DOF.scholarly_paper" begin open_monitor*[this::article] -declare[[strict_monitor_checking = false]] -declare[[ Definition_default_class="definition"]] -declare[[ Lemma_default_class="lemma"]] -declare[[ Theorem_default_class="theorem"]] +declare[[ strict_monitor_checking = false]] +declare[[ Definition_default_class = "definition"]] +declare[[ Lemma_default_class = "lemma"]] +declare[[ Theorem_default_class = "theorem"]] define_shortcut* csp \ \CSP\ + holcsp \ \HOL-CSP\ isabelle \ \Isabelle/HOL\ (*>*) @@ -24,7 +24,7 @@ author*[bu,email= "\wolff@lri.fr\",affiliation = "\LRI, Unive author*[lina,email="\lina.ye@lri.fr\",affiliation="\LRI, Inria, LSV, CentraleSupelec\"]\Lina Ye\ abstract*[abs, keywordlist="[\Shallow Embedding\,\Process-Algebra\, - \Concurrency\,\Computational Models\]"] + \Concurrency\,\Computational Models\]"] \ The theory of Communicating Sequential Processes going back to Hoare and Roscoe is still today one of the reference theories for concurrent specification and computing. In 1997, a first formalization in \<^isabelle> of the denotational semantics of the Failure/Divergence Model of @@ -63,8 +63,8 @@ systems, such as the T9000 transansputer @{cite "Barret95"}. The theory of \<^csp> was first described in 1978 in a book by Tony Hoare @{cite "Hoare:1985:CSP:3921"}, but has since evolved substantially @{cite "BrookesHR84" and "brookes-roscoe85" and "roscoe:csp:1998"}. \<^csp> describes the most common communication and synchronization mechanisms -with one single language primitive: synchronous communication written \_\_\_\. \<^csp> semantics is described -by a fully abstract model of behaviour designed to be \<^emph>\compositional\: the denotational +with one single language primitive: synchronous communication written \_\_\_\. \<^csp> semantics is +described by a fully abstract model of behaviour designed to be \<^emph>\compositional\: the denotational semantics of a process \P\ encompasses all possible behaviours of this process in the context of all possible environments \P \S\ Env\ (where \S\ is the set of \atomic events\ both \P\ and \Env\ must synchronize). This design objective has the consequence that two kinds of choice have to @@ -248,7 +248,7 @@ Second, in the traditional literature, the semantic domain is implicitly describ over the three semantic functions \\\, \\\ and \\\. Informally, these are: - \<^item> the initial trace of a process must be empty; + \<^item> the initial trace of a process must be empty; \<^item> any allowed trace must be \front\<^sub>-tickFree\; \<^item> traces of a process are \<^emph>\prefix-closed\; \<^item> a process can refuse all subsets of a refusal set; @@ -272,10 +272,10 @@ Informally, these are: (\ s t. s \ \ P \ tickFree s \ front_tickFree t \ s@t \ \ P) \ (\ s X. s \ \ P \ (s,X) \ \ P) \ (\ s. s@[\] \ \ P \ s \ \ P)\} - \<^vs>\-0.1cm\ + Our objective is to encapsulate this wishlist into a type constructed as a conservative -theory extension in our theory HOL-\<^csp>. +theory extension in our theory \<^holcsp>. Therefore third, we define a pre-type for processes \\ process\<^sub>0\ by \ \

(\\<^sup>\\<^sup>* \ \

(\\<^sup>\)) \ \

(\\<^sup>\)\. Forth, we turn our wishlist of "axioms" above into the definition of a predicate \is_process P\ of type \\ process\<^sub>0 \ bool\ deciding if its conditions are fulfilled. Since \P\ is a pre-process, @@ -302,7 +302,7 @@ maintains \is_process\, \<^ie> this predicate remains invariant on For example, we define \_\_\ on the pre-process type as follows: \<^vs>\0.1cm\ - \<^item> \<^theory_text>\definition "P \ Q \ Abs_process(\ P \ \ Q , \ P \ \ Q)"\ + \<^item> \<^theory_text>\definition "P \ Q \ Abs_processxx(\ P \ \ Q , \ P \ \ Q)"\ \<^vs>\-0.2cm\ \<^noindent> where \\ = fst \ Rep_process\ and \\ = snd \ Rep_process\ and where \Rep_process\ and @@ -532,9 +532,9 @@ To handle termination better, we added two new processes \CHAOS\<^sub>S\<^ \ (*<*) (* a test ...*) -text*[X22 ::math_content ]\\RUN A \ \ X. \ x \ A \ X\ \<^vs>\-0.7cm\ \ -text*[X32::"definition", mcc=defn]\\CHAOS A \ \ X. (STOP \ (\ x \ A \ X)) \<^vs>\-0.7cm\\\ -Definition*[X42]\\CHAOS\<^sub>S\<^sub>K\<^sub>I\<^sub>P A \ \ X. (SKIP \ STOP \ (\ x \ A \ X))\ \<^vs>\-0.7cm\\ +text*[X22 ::math_content ]\\RUN A \ \ X. \ x \ A \ X\ \<^vs>\-0.7cm\\ +text*[X32::"definition", mcc=defn]\\CHAOS A \ \ X. (STOP \ (\ x \ A \ X))\ \<^vs>\-0.7cm\\ +Definition*[X42]\\CHAOS\<^sub>S\<^sub>K\<^sub>I\<^sub>P A \ \ X. (SKIP \ STOP \ (\ x \ A \ X))\ \<^vs>\-0.7cm\\ Definition*[X52::"definition"]\\CHAOS\<^sub>S\<^sub>K\<^sub>I\<^sub>P A \ \ X. (SKIP \ STOP \ (\ x \ A \ X))\ \<^vs>\-0.7cm\\ text\ The \RUN\-process defined @{math_content X22} represents the process that accepts all @@ -546,21 +546,19 @@ stops or accepts any offered event, whereas \CHAOS\<^sub>S\<^sub>K\<^sub>I Definition*[X2]\\RUN A \ \ X. \ x \ A \ X\ \<^vs>\-0.7cm\\ Definition*[X3]\\CHAOS A \ \ X. (STOP \ (\ x \ A \ X))\ \<^vs>\-0.7cm\\ Definition*[X4]\\CHAOS\<^sub>S\<^sub>K\<^sub>I\<^sub>P A \ \ X. (SKIP \ STOP \ (\ x \ A \ X))\\<^vs>\-0.7cm\\ -Definition*[X5]\\DF A \ \ X. (\ x \ A \ X)\ \<^vs>\-0.7cm\\ -Definition*[X6]\\DF\<^sub>S\<^sub>K\<^sub>I\<^sub>P A \ \ X. ((\ x \ A \ X) \ SKIP)\ \<^vs>\-0.7cm\ \ +Definition*[X5]\\DF A \ \ X. (\ x \ A \ X)\ \<^vs>\-0.7cm\\ +Definition*[X6]\\DF\<^sub>S\<^sub>K\<^sub>I\<^sub>P A \ \ X. ((\ x \ A \ X) \ SKIP)\ \<^vs>\-0.7cm\ \ -text\ \<^vs>\-0.3cm\ \<^noindent> -In the following, we denote \ \\

= {DF\<^sub>S\<^sub>K\<^sub>I\<^sub>P, DF, RUN, CHAOS, CHAOS\<^sub>S\<^sub>K\<^sub>I\<^sub>P}\. +text\ \<^vs>\-0.3cm\ \<^noindent> In the following, we denote \ \\

= {DF\<^sub>S\<^sub>K\<^sub>I\<^sub>P, DF, RUN, CHAOS, CHAOS\<^sub>S\<^sub>K\<^sub>I\<^sub>P}\. All five reference processes are divergence-free. %which was done by using a particular lemma \\ (\ x. f x) = \\<^sub>i\<^sub>\\<^sub>\ \ (f\<^sup>i \)\. - -\<^vs>\-0.2cm\ - @{cartouche [display,indent=8] \ D (\ UNIV) = {} where \ \ \\

and UNIV is the set of all events\} - -\<^vs>\-0.1cm\ +@{cartouche + [display,indent=8] \ D (\ UNIV) = {} where \ \ \\

and UNIV is the set of all events\ +} Regarding the failure refinement ordering, the set of failures \\ P\ for any process \P\ is a subset of \\ (CHAOS\<^sub>S\<^sub>K\<^sub>I\<^sub>P UNIV)\.% and the following lemma was proved: -% This proof is performed by induction, based on the failure projection of \STOP\ and that of internal choice. +% This proof is performed by induction, based on the failure projection of \STOP\ and that of +% internal choice. \<^vs>\-0.2cm\ @{cartouche [display, indent=25] \CHAOS\<^sub>S\<^sub>K\<^sub>I\<^sub>P UNIV \\<^sub>\ P\} diff --git a/examples/technical_report/Isabelle_DOF-Manual/00_Frontmatter.thy b/examples/technical_report/Isabelle_DOF-Manual/00_Frontmatter.thy index 2456605..db1d713 100755 --- a/examples/technical_report/Isabelle_DOF-Manual/00_Frontmatter.thy +++ b/examples/technical_report/Isabelle_DOF-Manual/00_Frontmatter.thy @@ -17,13 +17,11 @@ theory "00_Frontmatter" begin -section\Document Local Setup.\ -text\Some internal setup, introducing document specific abbreviations and macros.\ +section\Local Document Setup.\ +text\... introducing document specific abbreviations and macros.\ - - -define_shortcut* dof \ \\dof\ - isadof \ \\isadof\ +define_shortcut* dof \ \\dof\ + isadof \ \\isadof\ define_shortcut* TeXLive \ \\TeXLive\ BibTeX \ \\BibTeX{}\ @@ -32,11 +30,11 @@ define_shortcut* TeXLive \ \\TeXLive\ pdf \ \PDF\ pdftex \ \\pdftex{}\ -text\Note that these setups assume that the associated \<^LaTeX> macros are defined, \<^eg>, - in the document prelude. \ +text\Note that these setups assume that the associated \<^LaTeX> macros + are defined, \<^eg>, in the document prelude. \ -setup\ DOF_lib.define_macro \<^binding>\index\ "\\index{" "}" (K(K())) (*no checking, no reporting*) - #> DOF_lib.define_macro \<^binding>\bindex\ "\\bindex{" "}"(K(K()))\ +define_macro* index \ \\index{\ \}\ +define_macro* bindex \ \\bindex{\ \}\ ML\ diff --git a/examples/technical_report/Isabelle_DOF-Manual/05_Implementation.thy b/examples/technical_report/Isabelle_DOF-Manual/05_Implementation.thy index a918c59..4377317 100755 --- a/examples/technical_report/Isabelle_DOF-Manual/05_Implementation.thy +++ b/examples/technical_report/Isabelle_DOF-Manual/05_Implementation.thy @@ -22,7 +22,7 @@ chapter*[isadof_developers::text_section]\Extending \<^isadof>\ text\ In this chapter, we describe the basic implementation aspects of \<^isadof>, which is based on the following design-decisions: - \<^item> the entire \<^isadof> is a ``pure add-on,'' \ie, we deliberately resign on the possibility to + \<^item> the entire \<^isadof> is a ``pure add-on,'' \<^ie>, we deliberately resign on the possibility to modify Isabelle itself. \<^item> we made a small exception to this rule: the \<^isadof> package modifies in its installation about 10 lines in the \LaTeX-generator (\path{src/patches/thy_output.ML}). diff --git a/src/DOF/Isa_COL.thy b/src/DOF/Isa_COL.thy index baea21a..d43998a 100755 --- a/src/DOF/Isa_COL.thy +++ b/src/DOF/Isa_COL.thy @@ -29,7 +29,7 @@ theory Isa_COL and "figure*" "side_by_side_figure*" :: document_body and "assert*" :: thy_decl - and "define_shortcut*" :: thy_decl + and "define_shortcut*" "define_macro*":: thy_decl begin @@ -293,9 +293,9 @@ fun define_macro name s1 s2 reportNtest = local (* hide away really strange local construction *) fun enclose_body2 front body1 middle body2 post = - (if front = "" then [] else [Latex.string front]) @ body1 @ + (if front = "" then [] else [Latex.string front]) @ body1 @ (if middle = "" then [] else [Latex.string middle]) @ body2 @ - (if post = "" then [] else [Latex.string post]); + (if post = "" then [] else [Latex.string post]); in fun define_macro2 name front middle post reportNtest1 reportNtest2 = Thy_Output.antiquotation_raw_embedded name (Scan.lift ( Args.cartouche_input @@ -416,19 +416,33 @@ end ML\ local -val parse_define_shortcut = Parse.binding -- - ((\<^keyword>\\\ || \<^keyword>\==\) |-- (Parse.alt_string || Parse.cartouche)) +val parse_literal = Parse.alt_string || Parse.cartouche +val parse_define_shortcut = Parse.binding -- ((\<^keyword>\\\ || \<^keyword>\==\) |-- parse_literal) val define_shortcuts = fold(uncurry DOF_lib.define_shortcut) in -val _ = - Outer_Syntax.command \<^command_keyword>\define_shortcut*\ "define LaTeX shortcut" - (Scan.repeat1 parse_define_shortcut >> (Toplevel.theory o define_shortcuts)); +val _ = Outer_Syntax.command \<^command_keyword>\define_shortcut*\ "define LaTeX shortcut" + (Scan.repeat1 parse_define_shortcut >> (Toplevel.theory o define_shortcuts)); end \ +ML\ +val parse_literal = Parse.alt_string || Parse.cartouche +val parse_define_shortcut = (Parse.binding + -- ((\<^keyword>\\\ || \<^keyword>\==\) |-- parse_literal)) + -- parse_literal + -- (Scan.option (\<^keyword>\(\ |-- Parse.ML_source --|\<^keyword>\)\)) + +fun define_macro (X,NONE) = (uncurry(uncurry(uncurry DOF_lib.define_macro)))(X,K(K())); + + +val _ = Outer_Syntax.command \<^command_keyword>\define_macro*\ "define LaTeX shortcut" + (Scan.repeat1 parse_define_shortcut >> (Toplevel.theory o (fold define_macro))); + +\ + + section\Tables\ (* TODO ! ! ! *) - (* dito the future monitor: table - block *) diff --git a/src/ontologies/scholarly_paper/scholarly_paper.thy b/src/ontologies/scholarly_paper/scholarly_paper.thy index 8f04f55..59e3210 100755 --- a/src/ontologies/scholarly_paper/scholarly_paper.thy +++ b/src/ontologies/scholarly_paper/scholarly_paper.thy @@ -477,12 +477,17 @@ subsection\Common Abbreviations\ define_shortcut* eg \ \\eg\ (* Latin: „exempli gratia“ meaning „for example“. *) ie \ \\ie\ (* Latin: „id est“ meaning „that is to say“. *) - etc \ \\etc\ (* Latin : et cetera *) + etc \ \\etc\ (* Latin : „et cetera“ meaning „et cetera“ *) subsection\Layout Trimming Commands\ +define_macro* hs \ \\hspace{\ \}\ +define_macro* vs \ \\vspace{\ \}\ + +(* setup\ DOF_lib.define_macro \<^binding>\hs\ "\\hspace{" "}" (K(K())) \ setup\ DOF_lib.define_macro \<^binding>\vs\ "\\vspace{" "}" (K(K())) \ +*) define_shortcut* clearpage \ \\clearpage{}\