Satisfiability and model checking for the linear-time μ-calculus
DefinitionSatisfiability of a closed linear μ-calculus formula#✓fully proved
A closed linear μ-calculus formula is satisfiable: some word and position satisfy it under the empty environment.
def linearMuSat (φ : Cslib.Modal.LinearMuCalculus.LinearMuFormula ℕ) : Prop :=
∃ (val : ℕ → ℕ → Prop) (n : ℕ),
Cslib.Modal.LinearMuCalculus.sat val (fun _ _ => False) φ n
inductive LinearMuFormula (Atom : Type u) : Type u where
| atom : Atom → LinearMuFormula Atom
| natom : Atom → LinearMuFormula Atom
| var : ℕ → LinearMuFormula Atom
| bot : LinearMuFormula Atom
| top : LinearMuFormula Atom
| and : LinearMuFormula Atom → LinearMuFormula Atom → LinearMuFormula Atom
| or : LinearMuFormula Atom → LinearMuFormula Atom → LinearMuFormula Atom
| next : LinearMuFormula Atom → LinearMuFormula Atom
| mu : LinearMuFormula Atom → LinearMuFormula Atom
| nu : LinearMuFormula Atom → LinearMuFormula Atom
CSLibExt/Logics/Modal/LinearMuCalculus.lean:61
def sat (env : ℕ → ℕ → Prop) : LinearMuFormula Atom → (ℕ → Prop)
| .atom a => fun n => val n a
| .natom a => fun n => ¬ val n a
| .var n => env n
| .bot => fun _ => False
| .top => fun _ => True
| .and φ ψ => fun n => sat env φ n ∧ sat env ψ n
| .or φ ψ => fun n => sat env φ n ∨ sat env ψ n
| .next φ => fun n => sat env φ (n + 1)
| .mu φ => fun n => ∀ S : ℕ → Prop,
(∀ m, sat (extendEnv env S) φ m → S m) → S n
| .nu φ => fun n => ∃ S : ℕ → Prop,
⋯
CSLibExt/Logics/Modal/LinearMuCalculus.lean:157
Uses 2 · Used by 1
DefinitionValidity of a closed linear μ-calculus formula#✓fully proved
A closed linear μ-calculus formula is valid: every word and position satisfy it under the empty environment.
def linearMuValid (φ : Cslib.Modal.LinearMuCalculus.LinearMuFormula ℕ) : Prop :=
∀ (val : ℕ → ℕ → Prop) (n : ℕ),
Cslib.Modal.LinearMuCalculus.sat val (fun _ _ => False) φ n
inductive LinearMuFormula (Atom : Type u) : Type u where
| atom : Atom → LinearMuFormula Atom
| natom : Atom → LinearMuFormula Atom
| var : ℕ → LinearMuFormula Atom
| bot : LinearMuFormula Atom
| top : LinearMuFormula Atom
| and : LinearMuFormula Atom → LinearMuFormula Atom → LinearMuFormula Atom
| or : LinearMuFormula Atom → LinearMuFormula Atom → LinearMuFormula Atom
| next : LinearMuFormula Atom → LinearMuFormula Atom
| mu : LinearMuFormula Atom → LinearMuFormula Atom
| nu : LinearMuFormula Atom → LinearMuFormula Atom
CSLibExt/Logics/Modal/LinearMuCalculus.lean:61
def sat (env : ℕ → ℕ → Prop) : LinearMuFormula Atom → (ℕ → Prop)
| .atom a => fun n => val n a
| .natom a => fun n => ¬ val n a
| .var n => env n
| .bot => fun _ => False
| .top => fun _ => True
| .and φ ψ => fun n => sat env φ n ∧ sat env ψ n
| .or φ ψ => fun n => sat env φ n ∨ sat env ψ n
| .next φ => fun n => sat env φ (n + 1)
| .mu φ => fun n => ∀ S : ℕ → Prop,
(∀ m, sat (extendEnv env S) φ m → S m) → S n
| .nu φ => fun n => ∃ S : ℕ → Prop,
⋯
CSLibExt/Logics/Modal/LinearMuCalculus.lean:157
Uses 2 · Used by 1
DefinitionLinear μ-calculus model checking on a finite Kripke structure#✓fully proved
Model checking a linear μ-calculus formula against a finite Kripke structure:
every infinite path π from start following edges satisfies φ at
position 0, where the path turns the structure's valuation worldVal into a
word valuation.
def linearMuModelCheck (edges : List (ℕ × ℕ)) (worldVal : ℕ → ℕ → Prop)
(start : ℕ) (φ : Cslib.Modal.LinearMuCalculus.LinearMuFormula ℕ) : Prop :=
∀ π : ℕ → ℕ, π 0 = start ∧ (∀ t, (π t, π (t + 1)) ∈ edges) →
Cslib.Modal.LinearMuCalculus.sat (fun t a => worldVal (π t) a)
(fun _ _ => False) φ 0
inductive LinearMuFormula (Atom : Type u) : Type u where
| atom : Atom → LinearMuFormula Atom
| natom : Atom → LinearMuFormula Atom
| var : ℕ → LinearMuFormula Atom
| bot : LinearMuFormula Atom
| top : LinearMuFormula Atom
| and : LinearMuFormula Atom → LinearMuFormula Atom → LinearMuFormula Atom
| or : LinearMuFormula Atom → LinearMuFormula Atom → LinearMuFormula Atom
| next : LinearMuFormula Atom → LinearMuFormula Atom
| mu : LinearMuFormula Atom → LinearMuFormula Atom
| nu : LinearMuFormula Atom → LinearMuFormula Atom
CSLibExt/Logics/Modal/LinearMuCalculus.lean:61
def sat (env : ℕ → ℕ → Prop) : LinearMuFormula Atom → (ℕ → Prop)
| .atom a => fun n => val n a
| .natom a => fun n => ¬ val n a
| .var n => env n
| .bot => fun _ => False
| .top => fun _ => True
| .and φ ψ => fun n => sat env φ n ∧ sat env ψ n
| .or φ ψ => fun n => sat env φ n ∨ sat env ψ n
| .next φ => fun n => sat env φ (n + 1)
| .mu φ => fun n => ∀ S : ℕ → Prop,
(∀ m, sat (extendEnv env S) φ m → S m) → S n
| .nu φ => fun n => ∃ S : ℕ → Prop,
⋯
CSLibExt/Logics/Modal/LinearMuCalculus.lean:157
Uses 2 · Used by 1
DefinitionLinear μ-calculus satisfiability as a decision problem#✓fully proved
Satisfiability of the linear μ-calculus as a decision problem over bitstrings: the input decodes to a formula token list, which decodes to a formula; the answer is whether that formula is closed and satisfiable.
noncomputable def linearMuSatDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode (α := List ℕ) x with
| some toks =>
match Cslib.Modal.LinearMuCalculus.linearMuDecodeList toks with
| some φ =>
if Cslib.Modal.LinearMuCalculus.LinearMuFormula.Closed φ ∧ linearMuSat φ
then true else false
| none => false
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
def linearMuDecodeList (l : List ℕ) : Option (LinearMuFormula ℕ) :=
match linearMuParseFuel (l.length + 1) l with
| some (φ, []) => some φ
| _ => none
CSLibExt/Logics/Modal/LinearMuCalculus.lean:1016
def Closed (φ : LinearMuFormula Atom) : Prop := ClosedAt 0 φ
CSLibExt/Logics/Modal/LinearMuCalculus.lean:118
def linearMuSat (φ : Cslib.Modal.LinearMuCalculus.LinearMuFormula ℕ) : Prop :=
∃ (val : ℕ → ℕ → Prop) (n : ℕ),
Cslib.Modal.LinearMuCalculus.sat val (fun _ _ => False) φ n
WantedExt/Complexity/KeyTheorems/LinearMuCalculusPSPACECompleteWanted.lean:70
Uses 13 · Used by 1
DefinitionLinear μ-calculus validity as a decision problem#✓fully proved
Validity of the linear μ-calculus as a decision problem over bitstrings.
noncomputable def linearMuValidDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode (α := List ℕ) x with
| some toks =>
match Cslib.Modal.LinearMuCalculus.linearMuDecodeList toks with
| some φ =>
if Cslib.Modal.LinearMuCalculus.LinearMuFormula.Closed φ ∧ linearMuValid φ
then true else false
| none => false
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
def linearMuDecodeList (l : List ℕ) : Option (LinearMuFormula ℕ) :=
match linearMuParseFuel (l.length + 1) l with
| some (φ, []) => some φ
| _ => none
CSLibExt/Logics/Modal/LinearMuCalculus.lean:1016
def Closed (φ : LinearMuFormula Atom) : Prop := ClosedAt 0 φ
CSLibExt/Logics/Modal/LinearMuCalculus.lean:118
def linearMuValid (φ : Cslib.Modal.LinearMuCalculus.LinearMuFormula ℕ) : Prop :=
∀ (val : ℕ → ℕ → Prop) (n : ℕ),
Cslib.Modal.LinearMuCalculus.sat val (fun _ _ => False) φ n
WantedExt/Complexity/KeyTheorems/LinearMuCalculusPSPACECompleteWanted.lean:76
Uses 13 · Used by 1
DefinitionLinear μ-calculus model checking as a decision problem#✓fully proved
Model checking of the linear μ-calculus as a decision problem over bitstrings:
the input decodes to (n, edges, worldVals, start, tokens), where worldVals
lists, per world, the atoms true at that world; the answer is whether the
decoded formula is closed, the structure is well-formed and total (every world
has a successor world, so the path quantification is not vacuous at deadlocks),
and every path from start satisfies the formula.
noncomputable def linearMuModelCheckDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := ℕ × List (ℕ × ℕ) × List (List ℕ) × ℕ × List ℕ) x with
| some (n, edges, worldVals, start, toks) =>
match Cslib.Modal.LinearMuCalculus.linearMuDecodeList toks with
| some φ =>
if Cslib.Modal.LinearMuCalculus.LinearMuFormula.Closed φ ∧ start < n ∧
(∀ e ∈ edges, e.1 < n ∧ e.2 < n) ∧
(∀ w, w < n → ∃ v, v < n ∧ (w, v) ∈ edges) ∧
linearMuModelCheck edges (fun w a => a ∈ worldVals.getD w []) start φ
then true else false
| none => false
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
def linearMuDecodeList (l : List ℕ) : Option (LinearMuFormula ℕ) :=
match linearMuParseFuel (l.length + 1) l with
| some (φ, []) => some φ
| _ => none
CSLibExt/Logics/Modal/LinearMuCalculus.lean:1016
def Closed (φ : LinearMuFormula Atom) : Prop := ClosedAt 0 φ
CSLibExt/Logics/Modal/LinearMuCalculus.lean:118
def linearMuModelCheck (edges : List (ℕ × ℕ)) (worldVal : ℕ → ℕ → Prop)
(start : ℕ) (φ : Cslib.Modal.LinearMuCalculus.LinearMuFormula ℕ) : Prop :=
∀ π : ℕ → ℕ, π 0 = start ∧ (∀ t, (π t, π (t + 1)) ∈ edges) →
Cslib.Modal.LinearMuCalculus.sat (fun t a => worldVal (π t) a)
(fun _ _ => False) φ 0
WantedExt/Complexity/KeyTheorems/LinearMuCalculusPSPACECompleteWanted.lean:84
Uses 13 · Used by 1
TheoremThe model checking, satisfiability and validity problems of the linear modal μ-calculus are PSPACE-complete#●ready to prove
The model checking, satisfiability and validity problems of the linear modal μ-calculus are PSPACE-complete, like for linear temporal logic. Source: M. Y. Vardi, "A temporal fixpoint calculus", POPL 1988, 250-259; cf. A. P. Sistla and E. M. Clarke, "The complexity of propositional linear temporal logics", JACM 32 (1985), 733-749.
public theorem_wanted linear_mu_calculus_pspace_complete :
(linearMuSatDec ∈ PSPACE ∧ ∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ PSPACE → Cslib.CookLevin.PolyManyOneRed L linearMuSatDec) ∧
(linearMuValidDec ∈ PSPACE ∧ ∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ PSPACE → Cslib.CookLevin.PolyManyOneRed L linearMuValidDec) ∧
(linearMuModelCheckDec ∈ PSPACE ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ PSPACE → Cslib.CookLevin.PolyManyOneRed L linearMuModelCheckDec)
noncomputable def linearMuSatDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode (α := List ℕ) x with
| some toks =>
match Cslib.Modal.LinearMuCalculus.linearMuDecodeList toks with
| some φ =>
if Cslib.Modal.LinearMuCalculus.LinearMuFormula.Closed φ ∧ linearMuSat φ
then true else false
| none => false
| none => false
WantedExt/Complexity/KeyTheorems/LinearMuCalculusPSPACECompleteWanted.lean:94
def PSPACE : DecisionComplexityClass :=
{L | langOf L ∈ Cslib.Turing.MultiTapeTM.Classes.PSPACE}
CSLibExt/Computability/Complexity/Classes.lean:117
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def PolyManyOneRed (L₁ L₂ : MetaMathlibExt.ComplexityTheory.DecisionProblem) : Prop :=
∃ reduce : List Bool → List Bool,
MetaMathlibExt.ComplexityTheory.IsPolyTime reduce ∧ ∀ x, L₁ x = L₂ (reduce x)
CSLibExt/Computability/CookLevin.lean:396
noncomputable def linearMuValidDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode (α := List ℕ) x with
| some toks =>
match Cslib.Modal.LinearMuCalculus.linearMuDecodeList toks with
| some φ =>
if Cslib.Modal.LinearMuCalculus.LinearMuFormula.Closed φ ∧ linearMuValid φ
then true else false
| none => false
| none => false
WantedExt/Complexity/KeyTheorems/LinearMuCalculusPSPACECompleteWanted.lean:107
noncomputable def linearMuModelCheckDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := ℕ × List (ℕ × ℕ) × List (List ℕ) × ℕ × List ℕ) x with
| some (n, edges, worldVals, start, toks) =>
match Cslib.Modal.LinearMuCalculus.linearMuDecodeList toks with
| some φ =>
if Cslib.Modal.LinearMuCalculus.LinearMuFormula.Closed φ ∧ start < n ∧
(∀ e ∈ edges, e.1 < n ∧ e.2 < n) ∧
(∀ w, w < n → ∃ v, v < n ∧ (w, v) ∈ edges) ∧
linearMuModelCheck edges (fun w a => a ∈ worldVals.getD w []) start φ
then true else false
⋯
WantedExt/Complexity/KeyTheorems/LinearMuCalculusPSPACECompleteWanted.lean:125
Uses 7
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.