Updated Isar notation.
Isabelle_DOF/Isabelle_DOF/master This commit looks good
Details
Isabelle_DOF/Isabelle_DOF/master This commit looks good
Details
This commit is contained in:
parent
8f22b53b18
commit
f8013d90a2
|
@ -7,7 +7,7 @@ begin
|
|||
|
||||
|
||||
|
||||
ML{*
|
||||
ML\<open>
|
||||
|
||||
fun value_maybe_select some_name =
|
||||
case some_name
|
||||
|
@ -30,11 +30,11 @@ fun value_cmd2 some_name modes raw_t state =
|
|||
Pretty.str "::", Pretty.brk 1, Pretty.quote (Syntax.pretty_typ ctxt' ty')]) ();
|
||||
in Pretty.writeln p end;
|
||||
|
||||
*}
|
||||
ML{* value_cmd2*}
|
||||
\<close>
|
||||
ML\<open>value_cmd2\<close>
|
||||
definition ASSERT :: "bool \<Rightarrow> bool" where "ASSERT p == (p=True)"
|
||||
ML{* val x = @{code "ASSERT"} *}
|
||||
ML{*
|
||||
ML\<open>val x = @{code "ASSERT"}\<close>
|
||||
ML\<open>
|
||||
val opt_modes =
|
||||
Scan.optional (@{keyword "("} |-- Parse.!!! (Scan.repeat1 Parse.name --| @{keyword ")"})) [];
|
||||
|
||||
|
@ -49,9 +49,9 @@ val _ =
|
|||
(* Toplevel.keep (Value_Command.value_cmd some_name modes (enclose "ASSERT(" ")" t)) *)
|
||||
Toplevel.keep (value_cmd2 some_name modes t)
|
||||
end));
|
||||
*}
|
||||
\<close>
|
||||
|
||||
assert "True"
|
||||
assert "True \<and> True "
|
||||
ML{* !TT ;
|
||||
@{term "True"} *}
|
||||
ML\<open>!TT ;
|
||||
@{term "True"}\<close>
|
|
@ -731,7 +731,7 @@ typedecl "thm"
|
|||
typedecl "file"
|
||||
typedecl "thy"
|
||||
|
||||
\<comment> \<open> and others in the future : file, http, thy, ... \<close>
|
||||
\<comment> \<open>and others in the future : file, http, thy, ...\<close>
|
||||
|
||||
consts ISA_typ :: "string \<Rightarrow> typ" ("@{typ _}")
|
||||
consts ISA_term :: "string \<Rightarrow> term" ("@{term _}")
|
||||
|
|
10
RegExp.thy
10
RegExp.thy
|
@ -25,22 +25,22 @@ definition opt :: "'a rexp \<Rightarrow> 'a rexp" ("\<lbrakk>(_)\<rbrakk>")
|
|||
where "\<lbrakk>A\<rbrakk> \<equiv> A || One"
|
||||
|
||||
value "Star (Conc(Alt (Atom(CHR ''a'')) (Atom(CHR ''b''))) (Atom(CHR ''c'')))"
|
||||
text{* or better equivalently: *}
|
||||
text\<open>or better equivalently:\<close>
|
||||
value "\<lbrace>(\<lfloor>CHR ''a''\<rfloor> || \<lfloor>CHR ''b''\<rfloor>) ~~ \<lfloor>CHR ''c''\<rfloor>\<rbrace>\<^sup>*"
|
||||
|
||||
section{* Definition of a semantic function: the ``language'' of the regular expression *}
|
||||
section\<open>Definition of a semantic function: the ``language'' of the regular expression\<close>
|
||||
text\<open> This is just a reminder - already defined in @{theory Regular_Exp} as @{term lang}.\<close>
|
||||
|
||||
text{* In the following, we give a semantics for our regular expressions, which so far have
|
||||
text\<open>In the following, we give a semantics for our regular expressions, which so far have
|
||||
just been a term language (i.e. abstract syntax). The semantics is a ``denotational semantics'',
|
||||
i.e. we give a direct meaning for regular expressions in some universe of ``denotations''.
|
||||
|
||||
This universe of denotations is in our concrete case: *}
|
||||
This universe of denotations is in our concrete case:\<close>
|
||||
|
||||
definition enabled :: "('a,'\<sigma> set)da \<Rightarrow> '\<sigma> set \<Rightarrow> 'a list \<Rightarrow> 'a list"
|
||||
where "enabled A \<sigma> = filter (\<lambda>x. next A x \<sigma> \<noteq> {}) "
|
||||
|
||||
text{* Now the denotational semantics for regular expression can be defined on a post-card: *}
|
||||
text\<open>Now the denotational semantics for regular expression can be defined on a post-card:\<close>
|
||||
|
||||
fun L :: "'a rexp => 'a lang"
|
||||
where L_Emp : "L Zero = {}"
|
||||
|
|
|
@ -37,20 +37,20 @@ definition opt :: "'a rexp \<Rightarrow> 'a rexp" ("\<lbrakk>(_)\<rbrakk>")
|
|||
where "\<lbrakk>A\<rbrakk> \<equiv> A || One"
|
||||
|
||||
value "Star (Conc(Alt (Atom(CHR ''a'')) (Atom(CHR ''b''))) (Atom(CHR ''c'')))"
|
||||
text{* or better equivalently: *}
|
||||
text\<open>or better equivalently:\<close>
|
||||
value "\<lbrace>(\<lfloor>CHR ''a''\<rfloor> || \<lfloor>CHR ''b''\<rfloor>) ~~ \<lfloor>CHR ''c''\<rfloor>\<rbrace>\<^sup>*"
|
||||
|
||||
section{* Some Standard and Derived Semantics *}
|
||||
section\<open>Some Standard and Derived Semantics\<close>
|
||||
text\<open> This is just a reminder - already defined in @{theory "Regular-Sets.Regular_Exp"}
|
||||
as @{term lang}.\<close>
|
||||
|
||||
text{* In the following, we give a semantics for our regular expressions, which so far have
|
||||
text\<open>In the following, we give a semantics for our regular expressions, which so far have
|
||||
just been a term language (i.e. abstract syntax). The semantics is a ``denotational semantics'',
|
||||
i.e. we give a direct meaning for regular expressions in some universe of ``denotations''.
|
||||
|
||||
This universe of denotations is in our concrete case: *}
|
||||
This universe of denotations is in our concrete case:\<close>
|
||||
|
||||
text{* Now the denotational semantics for regular expression can be defined on a post-card: *}
|
||||
text\<open>Now the denotational semantics for regular expression can be defined on a post-card:\<close>
|
||||
|
||||
fun L :: "'a rexp => 'a lang"
|
||||
where L_Emp : "L Zero = {}"
|
||||
|
|
|
@ -8,18 +8,18 @@ open_monitor*[exam::MathExam]
|
|||
|
||||
|
||||
section*[header::Header,examSubject= "[algebra]",
|
||||
date="''02-05-2018''", timeAllowed="90::int"] {* Exam number 1 *}
|
||||
text{*
|
||||
date="''02-05-2018''", timeAllowed="90::int"] \<open>Exam number 1\<close>
|
||||
text\<open>
|
||||
\begin{itemize}
|
||||
\item Use black ink or black ball-point pen.
|
||||
\item Draw diagrams in pencil.
|
||||
\item Answer all questions in the spaces provided.
|
||||
\end{itemize}
|
||||
*}
|
||||
\<close>
|
||||
|
||||
text*[idir::Author, affiliation="''CentraleSupelec''",
|
||||
email="''idir.aitsadoune@centralesupelec.fr''"]
|
||||
{*Idir AIT SADOUNE*}
|
||||
\<open>Idir AIT SADOUNE\<close>
|
||||
|
||||
|
||||
figure*[figure::figure, spawn_columns=False,
|
||||
|
@ -29,7 +29,7 @@ figure*[figure::figure, spawn_columns=False,
|
|||
|
||||
|
||||
subsubsection*[exo1 :: Exercise, content="[q1::Task,q2::Task]"]\<open>Exercise 1\<close>
|
||||
text{*
|
||||
text\<open>
|
||||
Here are the first four lines of a number pattern.
|
||||
\begin{itemize}
|
||||
\item Line 1 : @{term "1*6 + 2*4 = 2*7"}
|
||||
|
@ -37,15 +37,15 @@ Here are the first four lines of a number pattern.
|
|||
\item Line 3 : @{term "3*8 + 2*6 = 4*9"}
|
||||
\item Line 4 : @{term "4*9 + 2*7 = 5*10"}
|
||||
\end{itemize}
|
||||
*}
|
||||
\<close>
|
||||
|
||||
declare [[show_sorts=false]]
|
||||
subsubsection*[exo2 :: Exercise, content="[q1::Task,q2::Task]"]\<open>Exercise 2\<close>
|
||||
|
||||
text{* Find the roots of the polynome:
|
||||
text\<open>Find the roots of the polynome:
|
||||
@{term "(x^3) - 6 * x^2 + 5 * x + 12"}.
|
||||
Note the intermediate steps in the following fields and submit the solution. *}
|
||||
text{*
|
||||
Note the intermediate steps in the following fields and submit the solution.\<close>
|
||||
text\<open>
|
||||
\begin{Form}[action={http://your-web-server.com/path/receiveform.cgi}]
|
||||
\begin{tabular}{l}
|
||||
From @{term "(x^3) - 6 * x^2 + 5 * x + 12"} \\\\
|
||||
|
@ -57,7 +57,7 @@ text{*
|
|||
\Submit{Submit}\\
|
||||
\end{tabular}
|
||||
\end{Form}
|
||||
*}
|
||||
\<close>
|
||||
|
||||
(* a bit brutal, as long as lemma* does not yet work *)
|
||||
(*<*)
|
||||
|
@ -79,20 +79,20 @@ proof -
|
|||
qed
|
||||
(*>*)
|
||||
|
||||
text*[a1::Answer_Formal_Step]{* First Step: Fill in term and justification *}
|
||||
text*[a2::Answer_Formal_Step]{* Next Step: Fill in term and justification *}
|
||||
text*[a3::Answer_Formal_Step]{* Next Step: Fill in term and justification *}
|
||||
text*[a4::Answer_Formal_Step]{* Next Step: Fill in term and justification *}
|
||||
text*[a1::Answer_Formal_Step]\<open>First Step: Fill in term and justification\<close>
|
||||
text*[a2::Answer_Formal_Step]\<open>Next Step: Fill in term and justification\<close>
|
||||
text*[a3::Answer_Formal_Step]\<open>Next Step: Fill in term and justification\<close>
|
||||
text*[a4::Answer_Formal_Step]\<open>Next Step: Fill in term and justification\<close>
|
||||
|
||||
text*[q1::Task, local_grade="oneStar", mark="1::int", type="formal"]
|
||||
{* Complete Line 10 : @{term "10*x + 2*y = 11*16"} *}
|
||||
\<open>Complete Line 10 : @{term "10*x + 2*y = 11*16"}\<close>
|
||||
|
||||
subsubsection*[exo3 :: Exercise, content="[q1::Task,q2::Task]"]\<open>Exercise 3\<close>
|
||||
|
||||
text*[q2::Task, local_grade="threeStars", mark="3::int", type="formal"]
|
||||
{* Prove that @{term "n*(n+5) + 2*(n+3) "} is always the product of two numbers
|
||||
\<open>Prove that @{term "n*(n+5) + 2*(n+3) "} is always the product of two numbers
|
||||
with a difference of 5.
|
||||
*}
|
||||
\<close>
|
||||
(* this does not work on the level of the LaTeX output for known restrictions of the Toplevel. *)
|
||||
close_monitor*[exam :: MathExam]
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ is based on several design-decisions:
|
|||
\<close>
|
||||
|
||||
|
||||
subsection*["sec:plugins"::technical]{*Writing \isadof as User-Defined Plugin in Isabelle/Isar*}
|
||||
subsection*["sec:plugins"::technical]\<open>Writing \isadof as User-Defined Plugin in Isabelle/Isar\<close>
|
||||
text\<open>
|
||||
Writing an own plugin in Isabelle starts with defining the local data
|
||||
and registering it in the framework. As mentioned before, contexts
|
||||
|
@ -142,7 +142,7 @@ front-end supporting PIDE, a popup window with the text: ``declare
|
|||
document reference'' will appear.
|
||||
\<close>
|
||||
|
||||
subsection*["sec:prog_anti"::technical]{*Programming Text Antiquotations*}
|
||||
subsection*["sec:prog_anti"::technical]\<open>Programming Text Antiquotations\<close>
|
||||
text\<open>
|
||||
As mentioned in the introduction, Isabelle/Isar is configured with a
|
||||
number of standard commands to annotate formal definitions and proofs
|
||||
|
|
|
@ -5,7 +5,7 @@ begin
|
|||
(*>*)
|
||||
|
||||
chapter*[impl2::technical,main_author="Some(@{docitem ''bu''}::author)"]
|
||||
{* \isadof: Design and Implementation*}
|
||||
\<open>\isadof: Design and Implementation\<close>
|
||||
text\<open>
|
||||
In this section, we present the design and implementation of \isadof.
|
||||
\subsection{Document Ontology Modeling with \isadof}
|
||||
|
@ -110,7 +110,7 @@ expression consisting of the class identifier \inlineisar+A+,
|
|||
\inlineisar+B+, etc. Its use is discussed in \autoref{sec:monitor-class}.
|
||||
\<close>
|
||||
|
||||
subsection*[editing::example]{*Editing a Document with Ontology-Conform Meta-Data*}
|
||||
subsection*[editing::example]\<open>Editing a Document with Ontology-Conform Meta-Data\<close>
|
||||
text\<open>
|
||||
As already mentioned, Isabelle/Isar comes with a number of standard
|
||||
\emph{text commands} such as \inlineisar+section{* ... *}+ or
|
||||
|
@ -193,7 +193,7 @@ referencing it, although the actual text-element will occur later in
|
|||
the document.\<close>
|
||||
|
||||
|
||||
subsection*[ontolinks::technical]{*Ontology-Conform Logical Links: \isadof Antiquotations*}
|
||||
subsection*[ontolinks::technical]\<open>Ontology-Conform Logical Links: \isadof Antiquotations\<close>
|
||||
text\<open>
|
||||
Up to this point, the world of the formal and the informal document
|
||||
parts are strictly separated. The main objective of \isadof are ways
|
||||
|
@ -305,7 +305,7 @@ enforce that terms or theorems have a particular form or correspond to
|
|||
``claims'' (contributions) listed in the introduction of the paper.
|
||||
\<close>
|
||||
|
||||
subsection*["sec:monitor-class"::technical]{*Monitor Document Classes*}
|
||||
subsection*["sec:monitor-class"::technical]\<open>Monitor Document Classes\<close>
|
||||
text\<open>
|
||||
\autoref{lst:example} shows our conceptual running example in all
|
||||
details. While inheritance on document classes allows for structuring
|
||||
|
@ -353,7 +353,7 @@ text\<open>
|
|||
\end{isar}
|
||||
\<close>
|
||||
|
||||
section{*Document Generation*}
|
||||
section\<open>Document Generation\<close>
|
||||
text\<open>
|
||||
Up to know, we discussed the definition of ontologies and their
|
||||
representation in an interactive development environment, \ie,
|
||||
|
|
|
@ -388,7 +388,7 @@ doc_class TC = requirement +
|
|||
section\<open>Software Assurance related Entities and Concepts\<close>
|
||||
|
||||
|
||||
text{* subcategories are : *}
|
||||
text\<open>subcategories are :\<close>
|
||||
|
||||
text\<open>Table A.13: \<close>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ theory mathex_onto
|
|||
begin
|
||||
|
||||
(*<<*)
|
||||
text{* In our scenario, content has four different types of addressees:
|
||||
text\<open>In our scenario, content has four different types of addressees:
|
||||
\<^item> the @{emph \<open>setter\<close>}, i.e. the author of the exam,
|
||||
\<^item> the @{emph \<open>student\<close>}, i.e. the addressee of the exam,
|
||||
\<^item> the @{emph \<open>checker\<close>}, i.e. a person that checks the exam for
|
||||
|
@ -13,7 +13,7 @@ text{* In our scenario, content has four different types of addressees:
|
|||
Note that the latter quality assurance mechanism is used in many universities,
|
||||
where for organizational reasons the execution of an exam takes place in facilities
|
||||
where the author of the exam is not expected to be physically present.
|
||||
*}
|
||||
\<close>
|
||||
|
||||
|
||||
datatype ContentClass =
|
||||
|
@ -76,12 +76,12 @@ doc_class Exercise = Exam_item +
|
|||
concerns :: "ContentClass set" <= "{setter,student,checker,externalExaminer}"
|
||||
|
||||
|
||||
text{* In many institutions, it makes sense to have a rigorous process of validation
|
||||
text\<open>In many institutions, it makes sense to have a rigorous process of validation
|
||||
for exam subjects : is the initial question correct ? Is a proof in the sense of the
|
||||
question possible ? We model the possibility that the @{term setter} validates a
|
||||
question by a sample proof validated by Isabelle. In our scenario this sample proofs
|
||||
are completely @{emph \<open>intern\<close>}, i.e. not exposed to the students but just additional
|
||||
material for the internal review process of the exam.*}
|
||||
material for the internal review process of the exam.\<close>
|
||||
|
||||
doc_class Validation =
|
||||
tests :: "term list" <="[]"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
section{* An example ontology for a scholarly paper*}
|
||||
section\<open>An example ontology for a scholarly paper\<close>
|
||||
|
||||
theory scholarly_paper
|
||||
imports "../Isa_COL"
|
||||
|
@ -45,7 +45,7 @@ doc_class technical = text_section +
|
|||
definition_list :: "string list" <= "[]"
|
||||
formal_results :: "thm list"
|
||||
|
||||
text{* A very rough formatting style could be modeled as follows:*}
|
||||
text\<open>A very rough formatting style could be modeled as follows:\<close>
|
||||
|
||||
|
||||
doc_class example = text_section +
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
section{* An example ontology for a math paper*}
|
||||
section\<open>An example ontology for a math paper\<close>
|
||||
|
||||
theory small_math
|
||||
imports "../Isa_COL"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
section{* An example ontology for a scholarly paper*}
|
||||
section\<open>An example ontology for a scholarly paper\<close>
|
||||
|
||||
theory technical_report
|
||||
imports "scholarly_paper"
|
||||
|
|
Loading…
Reference in New Issue