Commit Graph

98 Commits

Author SHA1 Message Date
Nicolas Méric d2a6106be5 Fix the record generation in class implementation
- Fix the generation of the record associated with
  a class and used for the logic.
  The old implementation generated a new attribute
  for each attribute defined by a subclass,
  even the ones that were overriding ones of the superclass.
  The new implementation generates the attributes of the subclass
  which are not overriding ones.
  Warning:
  It implies that overridden attributes in a subclass are not
  new attributes added to the theory context.
  So the base name of an attribute will refer to the attribute
  of the last declared class where it is defined.
  If ones wants to refer to atttributes, one should use
  long names, even in the invariants of a subclass definition
  which overrides the attribute used in the invariant.
  For example,
  in ~~/src/ontologies/scholarly_paper/scholarly_paper.thy:

  doc_class technical = text_section +
     definition_list :: "string list" <=  "[]"
     status          :: status <= "description"
     formal_results  :: "thm list"
     invariant L1    :: "λσ::technical. the (level σ) > 0"

  type_synonym tc = technical (* technical content *)

  doc_class example  = text_section +
     referentiable   :: bool <= True
     status          :: status <= "description"
     short_name      :: string <= "''''"

  doc_class math_content = tc +
     referentiable :: bool <= True
     short_name    :: string <= "''''"
     status        :: status <= "semiformal"
     mcc           :: "math_content_class" <= "thm"
     invariant s1  :: "λ σ::math_content. ¬referentiable σ ⟶ short_name σ = ''''"
     invariant s2  :: "λ σ::math_content. technical.status σ = semiformal"

  The class math_content overrride the attribute status
  of the class technical, by using the type synonym tc,
  but the base name of this attribute refers
  to the attribute of the class example where it is last defined
  and not just overridden.
  So in the invariant s2 of the class math_content,
  we must use the long name of the attribute,
  i.e. the base name "status" with its qualifier which refers
  to the superclass where it is defined, the class technical.

  Type synonyms as qualifiers are not yet supported.
- Qualify classes that only override attributes of their superclass
  as vitual classes by adding a virtual attribute.
  This attribute is used to discriminate virtual classes and generate
  an adequate make function to initialize their associated record.
  The implementation uses an hidden attribute (the tag_attribute)
  to force the virtual class to be concrete or the logic
  by having a full new record definition associated with it.
  For example:

  doc_class W =
    a::"int" <= "1"

  doc_class X = W +
    a::"int" <= "2"

  The class X is tagged as a virtual class and
  the record make functions of the classes W and X are:

  W.make W_tag_attribute W_a
  X.make X_tag_attribute X_a X_tag_attribute

  So a record definition is added to the theory context for each class,
  even though a virtual class only overrides
  attributes of its superclass.
  This behavior allows us to support definitions of new default values
  for attributes in the subclass, as shown in the example.
- Factorize make name components
- Use Record name components instead of strings to refer to Record
  components
- Fix typos
2021-12-07 10:04:47 +01:00
Burkhart Wolff c14cb31639 ... 2021-10-14 20:31:21 +02:00
Burkhart Wolff f9027ef331 a section explaining the consequences of a doc-class and its shallow semantics in Isabelle records on different levels of representation 2021-07-18 17:34:52 +02:00
Burkhart Wolff 5aad659a85 some observations on invariant code generation 2021-07-01 13:12:18 +02:00
Burkhart Wolff f8801a1121 basically table_inline. 2021-05-13 14:37:27 +02:00
Burkhart Wolff 3b21df199b addded docitem ML antiquotation. (Kleine Fingeruebung). 2021-04-21 20:24:06 +02:00
Achim D. Brucker 0b6ef076b0 Initial support for svjour3-class from Springer. 2021-04-06 12:15:13 +01:00
Achim D. Brucker 46875b0560 Fixed version number. 2021-03-11 00:03:37 +00:00
Burkhart Wolff d86e708154 a first imprfect solution for the assert* problem; 4th chapter roughly completed. 2021-01-03 14:07:21 +01:00
Burkhart Wolff aee1d33709 renaming ISA's; new shortcuts; more content in the RefMan. 2021-01-02 15:57:28 +01:00
Burkhart Wolff 4c5aacb39f activated syntactic checks for trimming macros 2020-12-23 11:30:42 +01:00
Burkhart Wolff 005922ffda built in syntactic checks for trimming macros 2020-12-23 09:41:26 +01:00
Burkhart Wolff 6899c4059e improved macro syntax 2020-12-22 20:37:15 +01:00
Burkhart Wolff 5593c22a36 first version with macro syntax (no ML support) 2020-12-22 19:50:00 +01:00
Burkhart Wolff de5c0fc6e2 added Isar-syntax for define_shortcut* 2020-12-22 08:07:19 +01:00
Burkhart Wolff 0e64608a58 enforcing shorter Definition* - style in examples (CC,CENELEC,...) 2020-12-02 09:32:48 +01:00
Burkhart Wolff 8771d8581b default class checking bug fixed; new attributes for default classes in ontological macros Definition* Theorem* Lemma* 2020-12-01 23:18:13 +01:00
Achim D. Brucker c11e68e3ea Bug fix: Definition environment. 2020-12-01 07:46:20 +00:00
Burkhart Wolff efeee1e863 Eliminated deprecated abstract class residuals; lifted Definition* to math_content. 2020-11-10 13:07:54 +01:00
Burkhart Wolff 2ecb62a80e added Lemma*, Theorem* and Definition* support. Bug: referencing does not work. 2020-11-04 15:55:43 +01:00
Burkhart Wolff da0f3e63f1 more steps to reform document macro mechanism 2020-11-04 13:13:24 +01:00
Achim D. Brucker 1ad81aff35 Added support for explicit abstract* command. 2020-11-03 21:47:05 +00:00
Achim D. Brucker 1129a0ed3e Added support for explicit author* command. 2020-11-03 21:43:55 +00:00
Burkhart Wolff bad7dfc2ef new set of macros : author* and abstract* --- not working yet 2020-11-03 19:00:33 +01:00
Burkhart Wolff fe8f63690d macro-arrangement ... 2020-11-02 18:30:40 +01:00
Burkhart Wolff aa1fed2440 sdf 2020-11-02 14:12:27 +01:00
Burkhart Wolff abd32a802d First Pass of Chap 4 - Added invariant syntax description, more semantic content 2020-10-26 12:27:33 +01:00
Achim D. Brucker a175871474 Improved definition of \ie and \eg. 2020-10-06 04:45:14 +01:00
Burkhart Wolff d655effcf8 pushup. 2020-09-22 16:47:05 +02:00
Burkhart Wolff 9956bbf062 pushup, stiluebungen. 2020-09-22 16:35:28 +02:00
Burkhart Wolff 77e3490477 ... 2020-09-09 16:56:19 +02:00
Achim D. Brucker 3eef2291e5 Integrated DOF-scholarly_paper-thm.sty. 2020-09-07 23:57:15 +01:00
Achim D. Brucker 7956a3009a Initial commit: style for providing theorem-like default environments. 2020-09-07 23:56:43 +01:00
Burkhart Wolff 41a1eaed44 added define_macros, corrections in 02_Background 2020-08-26 14:38:39 +02:00
Burkhart Wolff 00c4d15259 first feedback on Yakoubs CC 2020-08-26 11:48:25 +02:00
Burkhart Wolff 338bb7d4a4 Code cleanup. 2020-08-25 11:59:10 +02:00
Burkhart Wolff d088d19f38 renamings - no reference to Iso which is possibly different 2020-08-24 09:40:56 +02:00
Burkhart Wolff 9a8b0c7c55 adapting Yakoubs Version on CC into our structure. Using our Definition setup. 2020-08-24 09:01:54 +02:00
Burkhart Wolff f35d498ad8 added stubs for CC project 2020-08-20 12:53:39 +02:00
Burkhart Wolff 1470776428 slight correction of the template, and addition of SML template instance in DOF-technical_report. Does not work for test-case in 05_Implementation (Commented out) 2020-06-24 13:11:26 +02:00
Burkhart Wolff ef93285ec7 added a little useful template generation command 2020-06-23 14:02:04 +02:00
Burkhart Wolff f5622c2f59 Merge branch 'master' of https://git.logicalhacking.com/Isabelle_DOF/Isabelle_DOF 2020-06-23 11:22:41 +02:00
Burkhart Wolff af9e399f50 some experiments with OoOP and the code support presentations. 2020-06-23 11:22:33 +02:00
Achim D. Brucker 1c5bb85233 Merge branch 'master' of git.logicalhacking.com:Isabelle_DOF/Isabelle_DOF 2020-06-23 07:29:20 +01:00
Achim D. Brucker 81ee0d9bbb Bug fix: support for UTF8 characters in author's names. 2020-06-23 06:56:35 +01:00
Burkhart Wolff 7e2224859e mmm 2020-06-22 17:42:40 +02:00
Burkhart Wolff d2d908534d Small corrections 2020-05-20 14:55:49 +02:00
Burkhart Wolff 9b0c2cdcd8 added support for defn, lem, thm short-calls. 2020-05-19 17:32:25 +02:00
Burkhart Wolff fa931b45e2 re-localization of onto macros. Tested. 2020-04-23 18:30:46 +02:00
Burkhart Wolff 6f8cd88623 nitty gritties 2020-04-23 16:59:49 +02:00