From 9496b535b763a2ee012c97640359a99fb0f105c0 Mon Sep 17 00:00:00 2001 From: bu Date: Thu, 23 Apr 2020 14:31:59 +0200 Subject: [PATCH] restructuring Lib. Adaption LaTeX. Reorg COL. --- .../CENELEC_50128/CENELEC_50128.thy | 124 ++++++++++-------- src/ontologies/math_paper/math_paper.thy | 2 +- .../scholarly_paper/DOF-scholarly_paper.sty | 67 ++++++++-- .../scholarly_paper/scholarly_paper.thy | 25 +++- src/tests/InnerSyntaxAntiquotations.thy | 6 +- 5 files changed, 147 insertions(+), 77 deletions(-) diff --git a/src/ontologies/CENELEC_50128/CENELEC_50128.thy b/src/ontologies/CENELEC_50128/CENELEC_50128.thy index f1ed167..cafc03d 100644 --- a/src/ontologies/CENELEC_50128/CENELEC_50128.thy +++ b/src/ontologies/CENELEC_50128/CENELEC_50128.thy @@ -25,28 +25,40 @@ identifies: (*<<*) theory CENELEC_50128 - imports "../../DOF/Isa_COL" + imports "../technical_report/technical_report" begin -(*>>*) + +text\We re-use the class @\typ math_content\, which provides also a framework for +semi-formal terminology, which we re-use by this definition.\ + +doc_class semi_formal_content = math_content + + status :: status <= "semiformal" + mcc :: math_content_class <= "terminology" + +type_synonym sfc = semi_formal_content + +(*>>*) text\ Excerpt of the BE EN 50128:2011, page 22. \ + section\Terms and Definitions\ -Definition*[assessment::concept]\process of analysis to determine whether software, which may include +Definition*[assessment::sfc,short_name="''assessment''"] +\process of analysis to determine whether software, which may include process, documentation, system, subsystem hardware and/or software components, meets the specified requirements and to form a judgement as to whether the software is fit for its intended purpose. Safety assessment is focused on but not limited to the safety properties of a system.\ -Definition*[assessor::concept, tag="''assessor''"] +Definition*[assessor::sfc, short_name="''assessor''"] \entity that carries out an assessment\ -Definition*[COTS::concept, tag="''commercial off-the-shelf software''"] +Definition*[COTS::sfc, short_name="''commercial off-the-shelf software''"] \software defined by market-driven need, commercially available and whose fitness for purpose has been demonstrated by a broad spectrum of commercial users\ -Definition*[component::concept] +Definition*[component::sfc] \a constituent part of software which has well-defined interfaces and behaviour with respect to the software architecture and design and fulfils the following criteria: @@ -57,108 +69,108 @@ criteria: (e. g. subsystems) which have an independent version \ -Definition*[CMGR::concept, tag="''configuration manager''"] +Definition*[CMGR::sfc, short_name="''configuration manager''"] \entity that is responsible for implementing and carrying out the processes for the configuration management of documents, software and related tools including \<^emph>\change management\\ -Definition*[customer::concept] +Definition*[customer::sfc] \entity which purchases a railway control and protection system including the software\ -Definition*[designer::concept] +Definition*[designer::sfc] \entity that analyses and transforms specified requirements into acceptable design solutions which have the required safety integrity level\ -Definition*[entity::concept] +Definition*[entity::sfc] \person, group or organisation who fulfils a role as defined in this European Standard\ -declare_reference*[fault::concept] -Definition*[error::concept] +declare_reference*[fault::sfc] +Definition*[error::sfc] \defect, mistake or inaccuracy which could result in failure or in a deviation -from the intended performance or behaviour (cf @{concept (unchecked) \fault\}))\ +from the intended performance or behaviour (cf @{semi_formal_content (unchecked) \fault\}))\ -Definition*[fault::concept] +Definition*[fault::sfc] \defect, mistake or inaccuracy which could result in failure or in a deviation -from the intended performance or behaviour (cf @{concept \error\})\ +from the intended performance or behaviour (cf @{semi_formal_content \error\})\ -Definition*[failure::concept] +Definition*[failure::sfc] \unacceptable difference between required and observed performance\ -Definition*[FT::concept, tag="''fault tolerance''"] +Definition*[FT::sfc, short_name="''fault tolerance''"] \built-in capability of a system to provide continued correct provision of service as specified, in the presence of a limited number of hardware or software faults\ -Definition*[firmware::concept] +Definition*[firmware::sfc] \software stored in read-only memory or in semi-permanent storage such as flash memory, in a way that is functionally independent of applicative software\ -Definition*[GS::concept,tag="''generic software''"] +Definition*[GS::sfc,short_name="''generic software''"] \software which can be used for a variety of installations purely by the provision of application-specific data and/or algorithms\ -Definition*[implementer::concept] +Definition*[implementer::sfc] \entity that transforms specified designs into their physical realisation\ -Definition*[integration::concept] +Definition*[integration::sfc] \process of assembling software and/or hardware items, according to the architectural and design specification, and testing the integrated unit\ -Definition*[integrator::concept] +Definition*[integrator::sfc] \entity that carries out software integration\ -Definition*[PES :: concept, tag="''pre-existing software''"] +Definition*[PES :: sfc, short_name="''pre-existing software''"] \software developed prior to the application currently in question, including COTS (commercial off-the shelf) and open source software\ -Definition*[OSS :: concept, tag="''open source software''"] +Definition*[OSS :: sfc, short_name="''open source software''"] \source code available to the general public with relaxed or non-existent copyright restrictions\ -Definition*[PLC::concept, tag="''programmable logic controller''"] +Definition*[PLC::sfc, short_name="''programmable logic controller''"] \solid-state control system which has a user programmable memory for storage of instructions to implement specific functions\ -Definition*[PM::concept, tag="''project management''"] +Definition*[PM::sfc, short_name="''project management''"] \administrative and/or technical conduct of a project, including safety aspects\ -Definition*[PGMGR::concept, tag="''project manager''"] +Definition*[PGMGR::sfc, short_name="''project manager''"] \entity that carries out project management\ -Definition*[reliability::concept] +Definition*[reliability::sfc] \ability of an item to perform a required function under given conditions for a given period of time\ -Definition*[robustness::concept] +Definition*[robustness::sfc] \ability of an item to detect and handle abnormal situations\ -Definition*[RMGR::concept, tag="''requirements manager''"] +Definition*[RMGR::sfc, short_name="''requirements manager''"] \entity that carries out requirements management\ -Definition*[RMGMT::concept, tag="''requirements management''"] +Definition*[RMGMT::sfc, short_name="''requirements management''"] \the process of eliciting, documenting, analysing, prioritising and agreeing on requirements and then controlling change and communicating to relevant stakeholders. It is a continuous process throughout a project\ -Definition*[risk::concept] +Definition*[risk::sfc] \combination of the rate of occurrence of accidents and incidents resulting in harm (caused by a hazard) and the degree of severity of that harm\ -Definition*[safety::concept] +Definition*[safety::sfc] \freedom from unacceptable levels of risk of harm to people\ -Definition*[SA::concept, tag="''safety authority''"] +Definition*[SA::sfc, short_name="''safety authority''"] \body responsible for certifying that safety related software or services comply with relevant statutory safety requirements\ -Definition*[SF::concept, tag="''safety function''"] +Definition*[SF::sfc, short_name="''safety function''"] \a function that implements a part or whole of a safety requirement\ -Definition*[SFRS::concept, tag= "''safety-related software''"] +Definition*[SFRS::sfc, short_name= "''safety-related software''"] \software which performs safety functions\ -Definition*[software::concept] +Definition*[software::sfc] \intellectual creation comprising the programs, procedures, rules, data and any associated documentation pertaining to the operation of a system\ -Definition*[SB::concept, tag="''software baseline''"] +Definition*[SB::sfc, short_name="''software baseline''"] \complete and consistent set of source code, executable files, configuration files, installation scripts and documentation that are needed for a software release. Information about compilers, operating systems, preexisting software and dependent tools is stored as part of the @@ -169,7 +181,7 @@ released and assessed -Definition*[SWLC::concept, tag="''software life-cycle''"] +Definition*[SWLC::sfc, short_name="''software life-cycle''"] \those activities occurring during a period of time that starts when software is conceived and ends when the software is no longer available for use. The software life cycle typically includes a requirements phase, design phase,test phase, integration phase, @@ -177,35 +189,35 @@ deployment phase and a maintenance phase 3.1.35 software maintainability capability of the software to be modified; to correct faults, improve to a different environment \ -Definition*[SM::concept, tag="''software maintenance''"] +Definition*[SM::sfc, short_name="''software maintenance''"] \ action, or set of actions, carried out on software after deployment functionality performance or other attributes, or adapt it with the aim of enhancing or correcting its\ -Definition*[SOSIL::concept, tag="''software safety integrity level''"] +Definition*[SOSIL::sfc, short_name="''software safety integrity level''"] \classification number which determines the techniques and measures that have to be applied to software NOTE Safety-related software has been classified into five safety integrity levels, where 0 is the lowest and 4 the highest.\ -Definition*[supplier::concept] +Definition*[supplier::sfc] \entity that designs and builds a railway control and protection system including the software or parts thereof\ -Definition*[SYSIL::concept, tag="''system safety integrity level''"] +Definition*[SYSIL::sfc, short_name="''system safety integrity level''"] \classification number which indicates the required degree of confidence that an integrated system comprising hardware and software will meet its specified safety requirements\ -Definition*[tester::concept]\an entity that carries out testing\ +Definition*[tester::sfc]\an entity that carries out testing\ -Definition*[testing::concept] +Definition*[testing::sfc] \process of executing software under controlled conditions as to ascertain its behaviour and performance compared to the corresponding requirements specification\ -Definition*[TCT1::concept, tag="''tool class T1''"] +Definition*[TCT1::sfc, short_name="''tool class T1''"] \generates no outputs which can directly or indirectly contribute to the executable code (including data) of the software NOTE 11 examples include: a text editor or a requirement or design support tool with no automatic code generation capabilities; configuration control tools.\ -Definition*[TCT2::concept,tag="''tool class T2''"] +Definition*[TCT2::sfc,short_name="''tool class T2''"] \supports the test or verification of the design or executable code, where errors in the tool can fail to reveal defects but cannot directly create errors in the executable software NOTE T2 examples include: a test harness generator; a test coverage measurement tool; a static @@ -213,35 +225,35 @@ analysis tool. reproduce defined versions and be the input for future releases a at upgrade in the maintenance phase \ -Definition*[TCT3::concept, tag="''tool class T3''"] +Definition*[TCT3::sfc, short_name="''tool class T3''"] \generates outputs which can directly or indirectly contribute to the executable code (including data) of the safety related system NOTE T3 examples include: a source code compiler, a data/algorithms compiler, a tool to change set-points during system operation; an optimising compiler where the relationship between the source code program and the generated object code is not obvious; a compiler that incorporates an executable run-time package into the executable code. \ -Definition*[traceability::concept] +Definition*[traceability::sfc, short_name="''traceability''"] \degree to which relationship can be established between two or more products of a development process, especially those having a predecessor/successor or master/subordinate relationship to one another\ -Definition*[validation::concept] +Definition*[validation::sfc, short_name="''validation''"] \process of analysis followed by a judgment based on evidence to documentation, software or application) fits the user needs,in particular with respect to safety and quality and determine whether an item (e.g. process, with emphasis on the suitability of its operation in accordance to its purpose in its intended environment\ -Definition*[validator::concept] +Definition*[validator::sfc, short_name="''validator''"] \entity that is responsible for the validation\ -Definition*[verification::concept] +Definition*[verification::sfc, short_name="''verification''"] \process of examination followed by a judgment based on evidence that output items (process, documentation, software or application) of a specific development phase fulfils the requirements of that phase with respect to completeness, correctness and consistency. NOTE Verification is mostly based on document reviews (design, implementation, test documents etc.). \ -Definition*[verifier::concept] +Definition*[verifier::sfc, short_name="''verifier''"] \entity that is responsible for one or more verification activities\ @@ -388,7 +400,7 @@ doc_class SIR = requirement + type_synonym safety_integrity_requirement = SIR text\The following class is a bit unclear about usage and seems to be in -conceptual mismatch with @{typ objectives}: \ +sfcual mismatch with @{typ objectives}: \ doc_class SILA = requirement + is_concerned :: "role set" <= "UNIV" alloc :: "sil" <= "SIL0" @@ -603,7 +615,7 @@ text\Objective: The objective of software verification is to examine and arrive at a judgement based on evidence that output items (process, documentation, software or application) of a specific development phase fulfil the requirements and plans with respect to completeness, correctness and consistency. -These activities are managed by the @{concept \verifier\}. +These activities are managed by the @{semi_formal_content \verifier\}. \ text\Outputs: @@ -705,7 +717,7 @@ doc_class test_documentation = section\ META : Testing and Validation \ -text\Test : @{concept \COTS\}\ +text\Test : @{semi_formal_content \COTS\}\ ML\ DOF_core.read_cid_global @{theory} "requirement"; diff --git a/src/ontologies/math_paper/math_paper.thy b/src/ontologies/math_paper/math_paper.thy index 572cc12..f537b5b 100644 --- a/src/ontologies/math_paper/math_paper.thy +++ b/src/ontologies/math_paper/math_paper.thy @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-2-Clause *************************************************************************) -chapter \The Document Ontology Common Library for the Isabelle Ontology Framework\ +chapter \A Math Paper Ontology (obsolete vs. scholarly_paper)\ text\ Offering support for common Isabelle Elements like definitions, lemma- and theorem statements, proofs, etc. Isabelle is a lot of things, but it is an interactive theorem diff --git a/src/ontologies/scholarly_paper/DOF-scholarly_paper.sty b/src/ontologies/scholarly_paper/DOF-scholarly_paper.sty index 98b0400..a4f59bf 100644 --- a/src/ontologies/scholarly_paper/DOF-scholarly_paper.sty +++ b/src/ontologies/scholarly_paper/DOF-scholarly_paper.sty @@ -160,7 +160,7 @@ % \newcommand{\formalMathStmt[label, mcc, ] % end: scholarly_paper.abstract - +% | "rule" | "assn" | "expl" | rem | "notation" | "terminology" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newisadof{text.scholarly_paper.math_content}% [label=,type=% @@ -210,16 +210,16 @@ {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.short_name}} {} } {\begin{lemma} \label{\commandkey{label}} #1 \end{lemma} } {\begin{lemma} [\commandkey{scholarly_paper.math_content.short_name}] - \label{\commandkey{label}} #1 + \label{\commandkey{label}} #1 \end{lemma}} }% }% - {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.mcc}}{ex}} + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.mcc}}{expl}} {% {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.short_name}} {} } {\begin{example} \label{\commandkey{label}} #1 \end{example} } {\begin{example} [\commandkey{scholarly_paper.math_content.short_name}] - \label{\commandkey{label}} #1 + \label{\commandkey{label}} #1 \end{example}} }% }% @@ -234,24 +234,63 @@ }% {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.mcc}}{prop}} {% - \begin{property}[\commandkey{scholarly_paper.math_content.short_name}] - \label{\commandkey{label}} #1 - \end{property}% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.short_name}} {} } + {\begin{property} \label{\commandkey{label}} #1 \end{property} } + {\begin{property} [\commandkey{scholarly_paper.math_content.short_name}] + \label{\commandkey{label}} #1 + \end{property}} + }% }% {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.mcc}}{rule}} {% - \begin{ruleX}[\commandkey{scholarly_paper.math_content.short_name}] - \label{\commandkey{label}} #1 - \end{ruleX}% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.short_name}} {} } + {\begin{ruleX} \label{\commandkey{label}} #1 \end{ruleX} } + {\begin{ruleX} [\commandkey{scholarly_paper.math_content.short_name}] + \label{\commandkey{label}} #1 + \end{ruleX}} + }% + }% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.mcc}}{rem}} + {% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.short_name}} {} } + {\begin{remark} \label{\commandkey{label}} #1 \end{remark} } + {\begin{remark} [\commandkey{scholarly_paper.math_content.short_name}] + \label{\commandkey{label}} #1 + \end{remark}} + }% }% {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.mcc}}{assn}} {% - \begin{assertion}[\commandkey{scholarly_paper.math_content.short_name}] - \label{\commandkey{label}} #1 - \end{assertion}% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.short_name}} {} } + {\begin{assertion} \label{\commandkey{label}} #1 \end{assertion} } + {\begin{assertion} [\commandkey{scholarly_paper.math_content.short_name}] + \label{\commandkey{label}} #1 + \end{assertion}} + }% + }% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.mcc}}{notation}} + {% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.short_name}} {} } + {\begin{notation} \label{\commandkey{label}} #1 \end{notation} } + {\begin{notation} [\commandkey{scholarly_paper.math_content.short_name}] + \label{\commandkey{label}} #1 + \end{notation}} + }% + }% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.mcc}}{terminology}} + {% + {\ifthenelse{\equal{\commandkey{scholarly_paper.math_content.short_name}} {} } + {\begin{terminology} \label{\commandkey{label}} #1 \end{terminology} } + {\begin{terminology} [\commandkey{scholarly_paper.math_content.short_name}] + \label{\commandkey{label}} #1 + \end{terminology}} + }% }% {% - \typeout{Internal error: enumeration out of sync} + \typeout{Internal error: enumeration out of sync with ontology scholarly-paper.} + }% + }% + }% }% }% }% diff --git a/src/ontologies/scholarly_paper/scholarly_paper.thy b/src/ontologies/scholarly_paper/scholarly_paper.thy index 88a2370..d01ade9 100644 --- a/src/ontologies/scholarly_paper/scholarly_paper.thy +++ b/src/ontologies/scholarly_paper/scholarly_paper.thy @@ -123,8 +123,9 @@ provided \<^emph>\theorem environments\ (see \<^verbatim>\tex \<^verbatim>\axiom\, \<^verbatim>\rule\ and \<^verbatim>\assertion\ to the list. A particular advantage of \<^verbatim>\texdoc amslatex\ is that it is well-established and compatible with many LaTeX - styles.\ -datatype math_content_class = "defn" | "axm" | "thm" | "lem" | "cor" | "prop" - | "ex" | "rule" | "assn" +datatype math_content_class = "defn" | "axm" | "thm" | "lem" | "cor" | "prop" + | "expl" | "rule" | "assn" + | rem | "notation" | "terminology" (* thm Theorem Italic @@ -132,7 +133,7 @@ cor Corollary Italic lem Lemma Italic prop Proposition defn Definition -ex Example +expl Example rem Remark notation @@ -184,27 +185,41 @@ type_synonym math_sfc = math_semiformal subsection\Instances of the abstract classes Definition / Class / Lemma etc.\ -text\A rough structuring is modeled as follows:\ +text\The key class definitions are motivated \ doc_class "definition" = math_content + referentiable :: bool <= True + mcc :: "math_content_class" <= "defn" + invariant d1 :: "\ \::definition. mcc \ = defn" doc_class "theorem" = math_content + referentiable :: bool <= True + mcc :: "math_content_class" <= "thm" + invariant d2 :: "\ \::theorem. mcc \ = thm" text\Note that the following two text-elements are currently set to no-keyword in LNCS style.\ doc_class "lemma" = math_content + referentiable :: bool <= "True" + mcc :: "math_content_class" <= "lem" + invariant d3 :: "\ \::lemma. mcc \ = lem" doc_class "corollary" = math_content + referentiable :: bool <= "True" + mcc :: "math_content_class" <= "cor" + invariant d4 :: "\ \::corollary. mcc \ = thm" + +doc_class "example" = math_content + + referentiable :: bool <= "True" + mcc :: "math_content_class" <= "expl" + invariant d5 :: "\ \::example. mcc \ = expl" + subsection\Example Statements\ text\ \<^verbatim>\examples\ are currently considered \<^verbatim>\technical\. Is a main category to be refined via inheritance. \ -doc_class example = technical + +doc_class tech_example = technical + referentiable :: bool <= True tag :: "string" <= "''''" diff --git a/src/tests/InnerSyntaxAntiquotations.thy b/src/tests/InnerSyntaxAntiquotations.thy index fe1a73a..271e2ab 100644 --- a/src/tests/InnerSyntaxAntiquotations.thy +++ b/src/tests/InnerSyntaxAntiquotations.thy @@ -11,7 +11,11 @@ * SPDX-License-Identifier: BSD-2-Clause *************************************************************************) -chapter\Inner Syntax Antiquotations (ISA)'s\ +chapter\Term Antiquotations\ + +text\Terms are represented by "Inner Syntax" parsed by an Earley parser in Isabelle. +For historical reasons, term antiquotations are called therefore somewhat misleadingly +"Inner Syntax Antiquotations". \ theory InnerSyntaxAntiquotations