Documentation

Cvc.Typed.Extra.Sys

Transition systems and bounded model checking, typed #

A Sys is a transition system over a symbol structure of state variables (see structure.symbols): an initial predicate, a transition relation between a state and the next, and named candidate invariants. Sys.Bmc checks the candidates on runs of increasing length.

Sys.Bmc.mk sys starts at step 0. check looks for a run whose state at the current step falsifies some remaining candidates: it answers their names and the checker without them, the counterexample recorded in falsified, or none once no remaining candidate can be falsified at this step. unroll then moves to the next step.

@[reducible, inline]
abbrev Cvc.Typed.Symbols.Sig.Candidates [Ω] {SVars : Sig} [Symbols SVars] :

Named candidate invariants: predicates over the state variables, at any step.

Equations
Instances For
    inductive Cvc.Typed.Sys.Trace (α : Nat → Type) (k : Nat) :

    One value per step, from step k down to step 0: an α i at step i.

    Instances For
      def Cvc.Typed.Sys.Trace.iterM {m : Type → Type u_1} {α : Nat → Type} {k : Nat} [Monad m] (f : {k : Nat} → α k → m Unit) :
      Trace α k → m Unit

      Runs f on each step's value, from step 0 up to step k.

      Equations
      Instances For
        def Cvc.Typed.Sys.Trace.getCurrent {α : Nat → Type} {k : Nat} :
        Trace α k → α k

        The value at step k, the last one.

        Equations
        Instances For
          def Cvc.Typed.Sys.Trace.getZero {α : Nat → Type} {k : Nat} :
          Trace α k → α 0

          The value at step 0.

          Equations
          Instances For
            @[reducible, inline]
            abbrev Cvc.Typed.Symbols.Sig.TermTrace {SVars : Sig} [Ω] (k : Nat) :

            A trace of unrolled Term-symbols.

            Equations
            Instances For
              @[reducible, inline]

              A trace of Lean-values for some unrolled symbols.

              Equations
              Instances For
                @[reducible, inline]

                A trace of Term-values for some unrolled symbols.

                Equations
                Instances For

                  Extracts the Term-values of a TermTrace.

                  Equations
                  Instances For
                    structure Cvc.Typed.Sys [Ω] (SVars : Symbols.Sig) [Symbols SVars] :

                    A transition system over the state variables SVars, with candidate invariants to check.

                    • idents : SVars.Idents

                      State variable identifiers.

                    • init : SVars.PredAt'

                      Initial predicate over SVars.

                    • next : SVars.RelAt'

                      Transition relation over SVars.

                    • Candidate properties over the system.

                    Instances For
                      @[reducible, inline]
                      abbrev Cvc.Typed.Symbols.Sig.Sys [Ω] (SVars : Sig) [Symbols SVars] :

                      Sys SVars, written SVars.Sys.

                      Equations
                      Instances For
                        def Cvc.Typed.Sys.initAt {SVars : Symbols.Sig} [Ω] [Symbols SVars] (sys : SVars.Sys) (solver : Solver) (k : Nat) :

                        Declares step k's state variables in solver, and answers the initial predicate on them.

                        Equations
                        Instances For
                          def Cvc.Typed.Sys.nextAt {SVars : Symbols.Sig} [Ω] [Symbols SVars] (sys : SVars.Sys) {k k' : Nat} (curr : SVars.TermsAt k) (next : SVars.TermsAt k') :

                          The transition relation from the state curr to the state next.

                          Equations
                          Instances For
                            structure Cvc.Typed.Sys.Bmc [Ω] (SVars : Symbols.Sig) [Symbols SVars] (k : Nat) :

                            Bounded model checking of a system, unrolled to step k.

                            Instances For
                              @[reducible, inline]
                              abbrev Cvc.Typed.Symbols.Sig.Bmc [Ω] (SVars : Sig) [Symbols SVars] (k : Nat) :

                              Sys.Bmc SVars k, written SVars.Bmc k.

                              Equations
                              Instances For
                                def Cvc.Typed.Sys.Bmc.mk {SVars : Symbols.Sig} [Ω] [Symbols SVars] (sys : SVars.Sys) :
                                Env (SVars.Bmc 0)

                                A checker for sys at step 0, on a new solver asserting the initial predicate.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Cvc.Typed.Sys.Bmc.isDone {SVars : Symbols.Sig} [Ω] [Symbols SVars] {k : Nat} (bmc : SVars.Bmc k) :

                                  Whether every candidate has been falsified.

                                  Equations
                                  Instances For
                                    def Cvc.Typed.Sys.Bmc.check {SVars : Symbols.Sig} [Ω] [Symbols SVars] {k : Nat} (bmc : SVars.Bmc k) :
                                    Env (Option (Array String × SVars.Bmc k))

                                    Looks for a run whose state at the current step falsifies some remaining candidates.

                                    Answers their names and the checker without them, the counterexample added to falsified, or none if no remaining candidate can be falsified at this step. Call it until it answers none.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def Cvc.Typed.Sys.Bmc.unroll {SVars : Symbols.Sig} [Ω] [Symbols SVars] {k : Nat} (bmc : SVars.Bmc k) :
                                      Env (SVars.Bmc k.succ)

                                      Moves to the next step: declares its state variables and asserts the transition into it.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For