Theory MLSSmf_Semantics
theory MLSSmf_Semantics imports
MLSSmf_Defs HereditarilyFinite.Finitary
begin
fun I⇩t :: "('v ⇒ hf) ⇒ ('f ⇒ hf ⇒ hf) ⇒ ('v, 'f) MLSSmf_term ⇒ hf" where
"I⇩t M⇩v M⇩f (∅⇩m _) = 0" |
"I⇩t M⇩v M⇩f (Var⇩m x) = M⇩v x" |
"I⇩t M⇩v M⇩f (t⇩1 ⊔⇩m t⇩2) = I⇩t M⇩v M⇩f t⇩1 ⊔ I⇩t M⇩v M⇩f t⇩2" |
"I⇩t M⇩v M⇩f (t⇩1 ⊓⇩m t⇩2) = I⇩t M⇩v M⇩f t⇩1 ⊓ I⇩t M⇩v M⇩f t⇩2" |
"I⇩t M⇩v M⇩f (t⇩1 -⇩m t⇩2) = I⇩t M⇩v M⇩f t⇩1 - I⇩t M⇩v M⇩f t⇩2" |
"I⇩t M⇩v M⇩f (Single⇩m t) = HF {I⇩t M⇩v M⇩f t}" |
"I⇩t M⇩v M⇩f (App f t) = (M⇩f f) (I⇩t M⇩v M⇩f t)"
fun I⇩a :: "('v ⇒ hf) ⇒ ('f ⇒ hf ⇒ hf) ⇒ ('v, 'f) MLSSmf_atom ⇒ bool" where
"I⇩a M⇩v M⇩f (t⇩1 ∈⇩m t⇩2) ⟷ I⇩t M⇩v M⇩f t⇩1 ❙∈ I⇩t M⇩v M⇩f t⇩2" |
"I⇩a M⇩v M⇩f (t⇩1 =⇩m t⇩2) ⟷ I⇩t M⇩v M⇩f t⇩1 = I⇩t M⇩v M⇩f t⇩2" |
"I⇩a M⇩v M⇩f (inc(f)) = (∀s t. s ≤ t ⟶ (M⇩f f) s ≤ (M⇩f f) t)" |
"I⇩a M⇩v M⇩f (dec(f)) = (∀s t. s ≤ t ⟶ (M⇩f f) t ≤ (M⇩f f) s)" |
"I⇩a M⇩v M⇩f (add(f)) = (∀s t. (M⇩f f) (s ⊔ t) = (M⇩f f) s ⊔ (M⇩f f) t)" |
"I⇩a M⇩v M⇩f (mul(f)) = (∀s t. (M⇩f f) (s ⊓ t) = (M⇩f f) s ⊓ (M⇩f f) t)" |
"I⇩a M⇩v M⇩f (f ≼⇩m g) = (∀s. (M⇩f f) s ≤ (M⇩f g) s)"
fun I⇩l :: "('v ⇒ hf) ⇒ ('f ⇒ hf ⇒ hf) ⇒ ('v, 'f) MLSSmf_literal ⇒ bool" where
"I⇩l M⇩v M⇩f (AT⇩m a) = I⇩a M⇩v M⇩f a" |
"I⇩l M⇩v M⇩f (AF⇩m a) = (¬ I⇩a M⇩v M⇩f a)"
fun I⇩c⇩l :: "('v ⇒ hf) ⇒ ('f ⇒ hf ⇒ hf) ⇒ ('v, 'f) MLSSmf_clause ⇒ bool" where
"I⇩c⇩l M⇩v M⇩f [] = True" |
"I⇩c⇩l M⇩v M⇩f (l # ls) = (I⇩l M⇩v M⇩f l ∧ I⇩c⇩l M⇩v M⇩f ls)"
lemma cl_is_true_iff_all_literals_true[iff]:
"I⇩c⇩l M⇩v M⇩f 𝒞 ⟷ (∀l ∈ set 𝒞. I⇩l M⇩v M⇩f l)"
proof
assume "I⇩c⇩l M⇩v M⇩f 𝒞"
then show "∀l∈set 𝒞. I⇩l M⇩v M⇩f l"
by (induction 𝒞) auto
next
assume "∀l∈set 𝒞. I⇩l M⇩v M⇩f l"
then show "I⇩c⇩l M⇩v M⇩f 𝒞"
by (induction 𝒞) auto
qed
end