(* Author: Dmitriy Traytel *) section ‹Monadic Second-Order Logic Formulas› (*<*) theory Formula imports Pi_Regular_Operators List_More begin (*>*) subsection ‹Interpretations and Encodings› type_synonym 'a interp = "'a list × (nat + nat set) list" abbreviation "enc_atom_bool I n ≡ map (λx. case x of Inl p ⇒ n = p | Inr P ⇒ n ∈ P) I" abbreviation "enc_atom I n a ≡ (a, enc_atom_bool I n)" subsection ‹Syntax and Semantics of MSO›