While this submission is a draft, it cannot be used by other submissions.

Executable bounded comparison of MSO and modal formulas

Lax369799.FiniteTesting · concepts/Lax369799/FiniteTesting.lean · lax-369799

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Theorem

    Enumerate finite Boolean graph tables up to the prescribed vertex bound. A second-order closure test filters exactly the reachable models, and the verified model checkers compare the two sentence semantics.

    Concept map
    26 concepts; 2 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
    Evidence

    Each proof establishes this claim relative to its assumptions.

    Lean source view on GitHub

    1import Lax369799.FiniteModelChecking
    2import Lax369799.FiniteModalData
    3
    4/-!
    5---
    6title: Executable bounded comparison of MSO and modal formulas
    7type: theorem
    8---
    9Enumerate finite Boolean graph tables up to the prescribed vertex bound.
    10A second-order closure test filters exactly the reachable models, and
    11the verified model checkers compare the two sentence semantics.
    12-/
    13
    14namespace Lax369799.FiniteTesting
    15open FiniteModelChecking
    16
    17def valid {P : Type} {k : ℕ} (G : Graph P k) : Bool :=
    18 decide (∀ X : Fin (k+1) → Bool,X G.1 = true →
    19 (∀ v w,X v = true → G.2.1 v w = true → X w = true) → ∀ v,X v = true)
    20
    21def agree {P : Type} {k : ℕ} (G : Graph P k) (φ : MonadicSecondOrder.Sentence P)
    22 (ψ : ModalMuCalculus.Sentence P) : Bool :=
    23 if valid G then (mso G φ == mu G ψ) else true
    24
    25def test {P : Type} [Fintype P] [Encodable P] [DecidableEq P] (K : ℕ)
    26 (φ : MonadicSecondOrder.Sentence P) (ψ : ModalMuCalculus.Sentence P) : Bool :=
    27 (List.range K).all (fun k => (FiniteModalData.elements (Graph P k)).all (fun G => agree G φ ψ))
    28
    29open TransitionSystems
    30
    31axiom test_correct {P : Type} [Fintype P] [Encodable P] [DecidableEq P] (K : ℕ)
    32 (φ : MonadicSecondOrder.Sentence P) (ψ : ModalMuCalculus.Sentence P) :
    33 test K φ ψ = true ↔ ∀ S : TransitionSystem P,S.size ≤ K →
    34 (MonadicSecondOrder.Models S φ ↔ ModalMuCalculus.Models S ψ)
    35
    36end Lax369799.FiniteTesting
    Show Proof

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…