Firstly, code:
Background:
datatype form = VAR "num"
| FALSE
| DISJ "form" "form"
| NOT "form"
| DIAM "form"
record 'a frame =
world :: "'a ⇒ bool"
rel :: "'a ⇒ 'a ⇒ bool"
record 'a model = "'a frame" +
valt :: "num ⇒ 'a ⇒ bool"
fun satis :: "'a model ⇒ 'a ⇒ form ⇒ bool"
where
"satis M w (VAR p) ⟷ (valt M p w ∧ world M w)"
| "satis M w FALSE ⟷ False"
| "satis M w (NOT f) ⟷ world M w ∧ ¬ satis M w f"
| "satis M w (DISJ f1 f2) ⟷ satis M w f1 ∨ satis M w f2"
| "satis M w (DIAM f) ⟷ world M w ∧ (∃ v. rel M w v ∧ world M v ∧ satis M v f)"
And the problem arises when I am attempting to translate this piece of HOL4 definition:
val valid_frame_state_def = Define`
valid_frame_state f w form = !M. M.frame = f ==> satis M w form`;
The difference is: in HOL4, a "frame" is a "field" of a term of the record type "model". Like this:
Datatype:
frame = <| world : 'a set ;
rel : 'a -> 'a -> bool
|>
End
Datatype:
model = <| frame : 'a frame;
valt : num -> 'a -> bool
|>
End
However, now I cannot write frame M
to extract the frame of a model as a field.
So the naive guess
definition valid_frame_state_def:
"valid_frame_state Fr w phi ≡ (⋀M. frame M = Fr ⟹ satis M w phi)"
will not work.
The definition "valid_frame_state" says "a modal formula phi is satisfied in a world w in a frame Fr iff for every model based on this frame, whatever the valuation of propositional letters are, the formula phi is satisfied at w".
How can I state that? Maybe it would be possible to re-assemble each component? But sound very not neat.
I just realized that there exists the option of let a frame be a field of M, and not to use the "+". But I think the canonical Isabelle treatment in the code above would look (and possibly work?) better.
https://isabelle.in.tum.de/library/Doc/Tutorial/Records.html
what to search for
how to fix it
That's a nice feature. Thank you! It is quickly fixed.
Last updated: Dec 21 2024 at 16:20 UTC