Theory DRA_Instantiation
section ‹Instantiation of the LTL to DRA construction›
theory DRA_Instantiation
imports
DRA_Implementation
LTL.Equivalence_Relations
LTL.Disjunctive_Normal_Form
"../Logical_Characterization/Extra_Equivalence_Relations"
"HOL-Library.Log_Nat"
Deriving.Derive
begin
subsection ‹Hash Functions for Quotient Types›
derive hashable ltln
definition "cube a = a * a * a"
instantiation set :: (hashable) hashable
begin
definition [simp]: "hashcode (x :: 'a set) = Finite_Set.fold (plus o cube o hashcode) (uint32_of_nat (card x)) x"
definition "def_hashmap_size = (λ_ :: 'a set itself. 2 * def_hashmap_size TYPE('a))"
instance
proof
from def_hashmap_size[where ?'a = "'a"]
show "1 < def_hashmap_size TYPE('a set)"
by (simp add: def_hashmap_size_set_def)
qed
end
instantiation fset :: (hashable) hashable
begin
definition [simp]: "hashcode (x :: 'a fset) = hashcode (fset x)"
definition "def_hashmap_size = (λ_ :: 'a fset itself. 2 * def_hashmap_size TYPE('a))"
instance
proof
from def_hashmap_size[where ?'a = "'a"]
show "1 < def_hashmap_size TYPE('a fset)"
by (simp add: def_hashmap_size_fset_def)
qed
end
instantiation ltln⇩P:: (hashable) hashable
begin
definition [simp]: "hashcode (φ :: 'a ltln⇩P) = hashcode (min_dnf (rep_ltln⇩P φ))"
definition "def_hashmap_size = (λ_ :: 'a ltln⇩P itself. def_hashmap_size TYPE('a ltln))"
instance
proof
from def_hashmap_size[where ?'a = "'a"]
show "1 < def_hashmap_size TYPE('a ltln⇩P)"
by (simp add: def_hashmap_size_ltln⇩P_def def_hashmap_size_ltln_def)
qed
end
instantiation ltln⇩Q :: (hashable) hashable
begin
definition [simp]: "hashcode (φ :: 'a ltln⇩Q) = hashcode (min_dnf (Unf (rep_ltln⇩Q φ)))"
definition "def_hashmap_size = (λ_ :: 'a ltln⇩Q itself. def_hashmap_size TYPE('a ltln))"
instance
proof
from def_hashmap_size[where ?'a = "'a"]
show "1 < def_hashmap_size TYPE('a ltln⇩Q)"
by (simp add: def_hashmap_size_ltln⇩Q_def def_hashmap_size_ltln_def)
qed
end
subsection ‹Interpretations with Equivalence Relations›
text ‹
We instantiate the construction locale with propositional equivalence
and obtain a function converting a formula into an abstract automaton.
›