Documentation

Pdl.UnfoldBox

Local Box Unfolding (Section 3.1) #

Preparation for Boxes: Test Profiles #

def TP (α : Program) :

Type of test profiles for a given program.

Equations
Instances For
    theorem TP_eq_iff {α : Program} {ℓ ℓ' : TP α} :
    = ℓ' τ(testsOfProgram α).attach, τ = ℓ' τ
    instance instCoeOutTPUnion {α β : Program} :
    CoeOut (TP (αβ)) (TP α)
    Equations
    instance instCoeOutTPUnion_1 {α β : Program} :
    CoeOut (TP (αβ)) (TP β)
    Equations
    instance instCoeOutTPSequence {α β : Program} :
    CoeOut (TP (α;'β)) (TP α)
    Equations
    instance instCoeOutTPSequence_1 {α β : Program} :
    CoeOut (TP (α;'β)) (TP β)
    Equations
    instance instCoeOutTPStar {α : Program} :
    CoeOut (TP (α)) (TP α)
    Equations
    def allTP (α : Program) :
    List (TP α)

    List of all test profiles for a given program. Note that in contrast to Fintype.elems : Finset (TP α) here we get a computable List (TP α).

    Equations
    Instances For
      theorem allTP_mem {α : Program} (ℓ : TP α) :
      allTP α

      All test profiles are in the list of all test profiles. Thanks to Floris van Doorn https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/List.20of.20.28provably.29.20all.20functions.20from.20given.20List.20to.20Bool

      def signature (α : Program) (ℓ : TP α) :

      σ^ℓ

      Equations
      Instances For
        theorem signature_iff {α : Program} {ℓ : TP α} {W : Type} {M : KripkeModel W} {w : W} :
        evaluate M w (signature α ) τ(testsOfProgram α).attach, τ = true evaluate M w τ
        theorem signature_contradiction_of_neq_TPs {α : Program} {ℓ ℓ' : TP α} :
        ℓ'contradiction (signature α signature α ℓ')
        theorem equiv_iff_TPequiv {φ ψ : Formula} {α : Program} :
        φψ ∀ ( : TP α), φsignature α ψsignature α

        Boxes: F, P, X and unfoldBox #

        Note: In P and Xset we use lists not sets, to eventually make formulas.

        def F (α : Program) (ℓ : TP α) :
        Equations
        Instances For
          def P (α : Program) (ℓ : TP α) :
          Equations
          Instances For
            def Xset (α : Program) (ℓ : TP α) (ψ : Formula) :
            Equations
            Instances For
              def unfoldBox (α : Program) (φ : Formula) :

              unfold_□(α,ψ)

              Equations
              Instances For
                theorem F_mem_iff_neg (α : Program) (ℓ : TP α) (φ : Formula) :
                φ F α ∃ (τ : Formula) (h : τ testsOfProgram α), φ = (~τ) τ, h = false
                theorem P_monotone (α : Program) (ℓ ℓ' : TP α) (h : ∀ (τ : { τ : Formula // τ testsOfProgram α }), τ = trueℓ' τ = true) (δ : List Program) :
                δ P α δ P α ℓ'
                theorem P_goes_down {δ : List Program} {γ α : Program} {ℓ : TP α} :
                γ δδ P α if α.isAtomic then γ = α else if α.isStar then lengthOfProgram γ lengthOfProgram α else lengthOfProgram γ < lengthOfProgram α
                theorem F_goes_down {α : Program} {ℓ : TP α} {φ : Formula} :
                φ F α lengthOfFormula φ < lengthOfProgram α
                theorem keepFreshF {x : } (α : Program) (ℓ : TP α) (x_notin : xα.voc) (φ : Formula) :
                φ F α xφ.voc
                theorem keepFreshP {x : } (α : Program) (ℓ : TP α) (x_notin : xα.voc) (δ : List Program) :
                δ P α xδ.pvoc
                @[irreducible]
                theorem boxHelperTermination (α : Program) (ℓ : TP α) (δ : List Program) :
                δ P α (α.isAtomicδ = [α]) (∀ (β : Program), α = (β)δ = [] ∃ (a : ) (δ1n : List Program), δ = [·a] ++ δ1n ++ [β] (·a) :: δ subprograms α) (¬α.isAtomic ¬α.isStarδ = [] ∃ (a : ) (δ1n : List Program), δ = [·a] ++ δ1n (·a) :: δ subprograms α)

                Depending on α we know what can occur inside δ ∈ P α ℓ for unfoldBox.

                theorem unfoldBoxContent (α : Program) (ψ : Formula) (X : List Formula) :
                X unfoldBox α ψφX, φ = ψ (∃ τtestsOfProgram α, φ = (~τ)) ∃ (a : ) (δ : List Program), (φ = ·a⌈⌈δ⌉⌉ψ) γ(·a) :: δ, γ subprograms α

                Where formulas in the unfolding can come from. The article also says φ ∈ fischerLadner [⌈α⌉ψ] which we omit here.

                theorem boxHelperTP (α : Program) (ℓ : TP α) :
                (∀ (τ : { τ : Formula // τ testsOfProgram α }), (~τ) F α τ = false) Con (F α )signature α signature α ∀ (ψ : Formula), Con (Xset α ψ)signature α Con (List.map (fun (αs : List Program) => ⌈⌈αs⌉⌉ψ) (P α ))signature α
                theorem guardToStar (x : ) (β : Program) (χ0 χ1 ρ ψ : Formula) (x_notin_beta : Sum.inl xβ.voc) (beta_equiv : (β·x)(·x)χ0χ1) (rho_imp_repl : ρrepl_in_F x ρ (χ0χ1)) (rho_imp_psi : ρψ) :
                theorem localBoxTruth_connector (γ : Program) (ψ : Formula) (goal : ∀ ( : TP γ), (γψ)signature γ Con (Xset γ ψ)signature γ ) :
                (γψ)dis (List.map (fun ( : TP γ) => Con (Xset γ ψ)) (allTP γ))

                Show "suffices" part outside, to use localBoxTruth for star case in localBoxTruthI.

                theorem localBoxTruthI (γ : Program) (ψ : Formula) (ℓ : TP γ) :
                (γψ)signature γ Con (Xset γ ψ)signature γ

                Induction claim for localBoxTruth.

                theorem localBoxTruth (γ : Program) (ψ : Formula) :
                (γψ)dis (List.map (fun ( : TP γ) => Con (Xset γ ψ)) (allTP γ))
                theorem existsBoxFP {W✝ : Type} {M : KripkeModel W✝} {v w : W✝} (γ : Program) (v_γ_w : relate M γ v w) (ℓ : TP γ) (v_conF : (M, v)Con (F γ )) :
                δP γ , relateSeq M δ v w