Theory AnswerIndexedFamilies
theory AnswerIndexedFamilies
imports Main
begin
chapter ‹Answer-Indexed Families›
typedecl 'a state
consts L :: ‹'a state => 'a set›
datatype answer = T | F
type_synonym 'a AiF = ‹answer ⇒ 'a set›
fun and_AiF :: ‹'a AiF ⇒ 'a AiF ⇒ 'a AiF› (infixl ‹∧·› 60) where
‹(a ∧· b) T = a T ∩ b T›
| ‹(a ∧· b) F = a F ∪ b F›
fun or_AiF :: ‹'a AiF ⇒ 'a AiF ⇒ 'a AiF› (infixl ‹∨·› 59) where
‹(a ∨· b) T = a T ∪ b T›
| ‹(a ∨· b) F = a F ∩ b F›
fun not_AiF :: ‹'a AiF ⇒ 'a AiF› (‹¬· _›) where
‹(¬· a) T = a F›
| ‹(¬· a) F = a T›
fun univ_AiF :: ‹'a AiF› (‹T∙›) where
‹T∙ T = UNIV›
| ‹T∙ F = {}›
fun satisfying_AiF :: ‹'a ⇒ 'a state AiF› (‹sat∙›) where
‹sat∙ x T = {state. x ∈ L state}›
| ‹sat∙ x F = {state. x ∉ L state}›
section ‹Example: Propositional logic›