Documentation

Pdl.Interpolation.QFormula

Q-formulas and their normal form (Definitions 9.15, 9.16 and Fact 9.17) #

The pre-interpolants of Definition 9.18 are not arbitrary formulas: they are built from "ordinary" formulas and from internal variables q_x, one for each companion node x of the quasi-tableau Q, using only conjunction and (sequences of) boxes.

Instead of using fresh proposition letters for the internal variables we use a separate constructor QFormula.var of a new data type QFormula Var, where Var is the type of internal variables. This makes the side condition of Definition 9.15 — that the vocabulary of the ordinary formulas ψ and of the programs α⃗ contains no internal variables — true by construction, and it avoids having to pick fresh proposition letters.

To read a QFormula as an actual Formula one has to say what the internal variables stand for. This is done by QFormula.subst σ where σ : Var → Formula. Taking σ x = ·(n x) for an injection n into unused proposition letters gives the formulas of the paper, but the extra generality is exactly what is needed later: in the correctness proof the internal variables get replaced by other formulas.

Definition 9.15: the language L_Q #

inductive QFormula (Var : Type) :

Def 9.15: the set L_Q of Q-formulas, given by the grammar ι ::= ψ | q | ι ∧ ι | □(α⃗, ι). Here Var is the type of internal variables, i.e. the paper's { q_x | x ∈ K_Q }. The side condition that ψ and α⃗ contain no internal variables is automatic here because internal variables are not Formulas.

Instances For
    @[instance_reducible]
    instance instReprQFormula {Var✝ : Type} [Repr Var✝] :
    Repr (QFormula Var✝)
    Equations
    def instReprQFormula.repr {Var✝ : Type} [Repr Var✝] :
    QFormula Var✝Std.Format
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def QFormula.subst {Var : Type} (σ : VarFormula) :

      Replace the internal variables in a Q-formula according to σ, yielding a Formula. For σ x = ·(n x) with n injective into unused proposition letters this is the formula that the paper denotes by ι itself.

      Equations
      Instances For
        @[simp]
        theorem QFormula.subst_fma {Var : Type} {σ : VarFormula} {ψ : Formula} :
        subst σ (fma ψ) = ψ
        @[simp]
        theorem QFormula.subst_var {Var : Type} {σ : VarFormula} {q : Var} :
        subst σ (var q) = σ q
        @[simp]
        theorem QFormula.subst_and {Var : Type} {σ : VarFormula} {ι1 ι2 : QFormula Var} :
        subst σ (ι1.and ι2) = subst σ ι1 subst σ ι2
        @[simp]
        theorem QFormula.subst_boxes {Var : Type} {σ : VarFormula} {as : List Program} {ι : QFormula Var} :
        subst σ (boxes as ι) = ⌈⌈as⌉⌉subst σ ι
        def QFormula.vars {Var : Type} :
        QFormula VarList Var

        The internal variables occurring in a Q-formula.

        Equations
        Instances For
          @[irreducible]
          def QFormula.substVar {Var : Type} [DecidableEq Var] (x : Var) (ρ ι : QFormula Var) :

          Substitute the Q-formula ρ for the internal variable x.

          Equations
          Instances For
            def QFormula.conj {Var : Type} :
            List (QFormula Var)QFormula Var

            Big conjunction of a list of Q-formulas, mirroring con on formulas.

            Equations
            Instances For
              @[simp]
              theorem QFormula.conj_nil {Var : Type} :
              @[simp]
              theorem QFormula.conj_singleton {Var : Type} {ι : QFormula Var} :
              conj [ι] = ι
              theorem QFormula.subst_conj {Var : Type} (σ : VarFormula) (L : List (QFormula Var)) :
              subst σ (conj L) = con (List.map (subst σ) L)

              Substitution commutes with big conjunction.

              Simple Q-formulas and Definition 9.16: the normal form #

              inductive QSimple (Var : Type) :

              A simple Q-formula (Def 9.15): either an ordinary formula ψ or a box □(α⃗, q_x) over an internal variable.

              Instances For
                def instReprQSimple.repr {Var✝ : Type} [Repr Var✝] :
                QSimple Var✝Std.Format
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[instance_reducible]
                  instance instReprQSimple {Var✝ : Type} [Repr Var✝] :
                  Repr (QSimple Var✝)
                  Equations
                  def instDecidableEqQSimple.decEq {Var✝ : Type} [DecidableEq Var✝] (x✝ x✝¹ : QSimple Var✝) :
                  Decidable (x✝ = x✝¹)
                  Equations
                  Instances For
                    @[instance_reducible]
                    instance instDecidableEqQSimple {Var✝ : Type} [DecidableEq Var✝] :
                    Equations
                    def QSimple.toQ {Var : Type} :
                    QSimple VarQFormula Var

                    A simple Q-formula is a Q-formula.

                    Equations
                    Instances For
                      def QSimple.prefixBoxes {Var : Type} (as : List Program) :
                      QSimple VarQSimple Var

                      Prefix a simple Q-formula with a sequence of boxes; the result is again simple.

                      Equations
                      Instances For
                        @[simp]
                        theorem QSimple.toQ_prefixBoxes {Var : Type} (as : List Program) (s : QSimple Var) (σ : VarFormula) :
                        def QSimple.mentions {Var : Type} [DecidableEq Var] (x : Var) :
                        QSimple VarBool

                        Does the simple Q-formula mention the internal variable x?

                        Equations
                        Instances For
                          def QSimple.progTo? {Var : Type} [DecidableEq Var] (x : Var) :

                          If the simple Q-formula is □(α⃗, q_x) then return the program α⃗ as one program.

                          Equations
                          Instances For
                            def QFormula.Spl {Var : Type} :
                            QFormula VarList (QSimple Var)

                            Def 9.16: the finite set Spl(ι) of simple Q-formulas of a Q-formula ι. Note that Spl(q_x) = { [⊤?]q_x }, i.e. we make the variable into a box formula.

                            Equations
                            Instances For
                              theorem QFormula.Spl_ne_nil {Var : Type} (ι : QFormula Var) :

                              Spl(ι) is never empty.

                              def QFormula.nf {Var : Type} (ι : QFormula Var) :

                              Def 9.16: the normal form ι^nf of a Q-formula, the conjunction of Spl(ι).

                              Equations
                              Instances For
                                def QFormula.IsNormalForm {Var : Type} (ι : QFormula Var) :

                                Being in normal form: a conjunction of simple Q-formulas.

                                Equations
                                Instances For
                                  theorem QFormula.eval_nf_iff {Var W : Type} {M : KripkeModel W} {w : W} (σ : VarFormula) (ι : QFormula Var) :
                                  evaluate M w (subst σ ι.nf) sι.Spl, evaluate M w (subst σ s.toQ)

                                  Evaluating a normal form means evaluating all its simple conjuncts.

                                  Fact 9.17 #

                                  theorem QFormula.eval_nf {Var W : Type} {M : KripkeModel W} {w : W} (σ : VarFormula) (ι : QFormula Var) :
                                  evaluate M w (subst σ ι.nf) evaluate M w (subst σ ι)

                                  Fact 9.17, first part: every Q-formula is equivalent to its normal form.

                                  theorem QFormula.voc_toQ_prefixBoxes {Var : Type} (as : List Program) (s : QSimple Var) (σ : VarFormula) :

                                  The vocabulary of a simple Q-formula prefixed with boxes.

                                  theorem QFormula.mem_voc_nf {Var : Type} {n : } (σ : VarFormula) (ι : QFormula Var) :
                                  n (subst σ ι.nf).voc sι.Spl, n (subst σ s.toQ).voc

                                  The vocabulary of a normal form is the union of the vocabularies of its conjuncts.

                                  theorem QFormula.voc_nf {Var : Type} (σ : VarFormula) (ι : QFormula Var) :
                                  (subst σ ι.nf).voc = (subst σ ι).voc

                                  Fact 9.17, second part: a Q-formula and its normal form have the same vocabulary.

                                  The fixpoint elimination used at companion nodes (part of Definition 9.18) #

                                  Given ι with normal form ⋀ᵢ [αᵢ]q_x ∧ ⋀ⱼ [βⱼ]q_{zⱼ} ∧ ψ, the pre-interpolant of the companion x is [(⋃ᵢ αᵢ)*](⋀ⱼ [βⱼ]q_{zⱼ} ∧ ψ). We implement this here as QFormula.gfp x ι, using Spl to read off the αᵢ and the remaining conjuncts.

                                  def QFormula.loopProgs {Var : Type} [DecidableEq Var] (x : Var) (ι : QFormula Var) :

                                  The programs αᵢ such that [αᵢ]q_x is a conjunct of the normal form of ι.

                                  Equations
                                  Instances For
                                    def QFormula.dropVar {Var : Type} [DecidableEq Var] (x : Var) (ι : QFormula Var) :

                                    The conjunction of those conjuncts of the normal form of ι that do not mention the internal variable x.

                                    Equations
                                    Instances For
                                      def QFormula.gfp {Var : Type} [DecidableEq Var] (x : Var) (ι : QFormula Var) :

                                      The greatest fixpoint of ι with respect to the internal variable x, i.e. the formula [(⋃ᵢ αᵢ)*](⋀ⱼ [βⱼ]q_{zⱼ} ∧ ψ) of the companion case of Definition 9.18.

                                      Equations
                                      Instances For
                                        theorem QFormula.not_mem_vars_gfp {Var : Type} [DecidableEq Var] (x : Var) (ι : QFormula Var) :
                                        x(gfp x ι).vars

                                        The internal variable x no longer occurs in gfp x ι.