Theory OCL_Syntax
chapter ‹Abstract Syntax›
theory OCL_Syntax
imports Complex_Main Object_Model OCL_Types
begin
section ‹Preliminaries›
type_synonym vname = "String.literal"
type_synonym 'a env = "vname ⇀⇩f 'a"
text ‹
In OCL @{text "1 + ∞ = ⊥"}. So we do not use @{typ enat} and
define the new data type.›
typedef unat = "UNIV :: nat option set" ..
definition "unat x ≡ Abs_unat (Some x)"
instantiation unat :: infinity
begin
definition "∞ ≡ Abs_unat None"
instance ..
end
free_constructors cases_unat for
unat
| "∞ :: unat"
unfolding unat_def infinity_unat_def
apply (metis Rep_unat_inverse option.collapse)
apply (metis Abs_unat_inverse UNIV_I option.sel)
by (simp add: Abs_unat_inject)
section ‹Standard Library Operations›
datatype metaop = AllInstancesOp