Documentation

Cvc.Untyped.Proof

Inspecting proofs, sort-erased #

A proof is what an unsat answer can be asked for, with Solver.getUnsatProof. This module takes one apart:

Solver.Proofs.fold and Solver.Proofs.foldUp do the same over several proofs at once, sharing what they visit, which is what the components other than full answer: one proof per theory lemma, for instance.

Every traversal visits a step shared by many others once, as Cvc.Proof explains.

@[reducible, inline]

A step of a sort-erased proof, taken apart: Cvc.Proof.View over sort-erased terms.

Equations
Instances For

    Decoding a step #

    def Cvc.Untyped.Solver.Proof.viewWith {pc : Proof.Component} [Ω] {s : Solver} (p : s.Proof pc) {X : Type} (premises : Array X) :

    The root step of p, taken apart, with premises standing for its premises.

    What view and foldUp are built on: view passes the premises themselves, foldUp what it computed for them. premises is expected to hold one element per premise, in order, as getChildren does; a step whose premises do not match its rule's layout is other.

    Equations
    Instances For

      The root step of p, taken apart: its rule a constructor, its premises and arguments fields.

      Equations
      Instances For

        Traversing #

        def Cvc.Untyped.Solver.Proof.fold {pc : Proof.Component} [Ω] {s : Solver} (p : s.Proof pc) {m : Type → Type u_1} {σ : Type} [Monad m] (init : σ) (pre : s.Proof pc → s.ProofView pc → σ → m (FoldPre σ) := fun (x : s.Proof pc) (x_1 : s.ProofView pc) (s : σ) => pure (FoldPre.descend s)) (post : s.Proof pc → s.ProofView pc → σ → m (FoldPost σ) := fun (x : s.Proof pc) (x_1 : s.ProofView pc) (s : σ) => pure (FoldPost.continue s)) (revisit : Bool := false) :
        m σ

        Folds over the distinct steps of p, depth-first, with early exit, in any monad.

        Each step is handed over with its view. pre is called on reaching a step, before its premises, and can skip them or stop; post on leaving it, once its premises are done, and can stop. Both default to carrying on.

        A step shared by several others is visited once, on the first path that reaches it, unless revisit is set — which can take exponentially long.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Cvc.Untyped.Solver.Proof.foldUp {pc : Proof.Component} [Ω] {s : Solver} (p : s.Proof pc) {m : Type → Type u_1} {β : Type} [Monad m] (f : s.Proof pc → Proof.View β Term Term → m β) :
          m β

          Computes a value for every distinct step of p, bottom-up, and answers the root's.

          f is handed each step with its view, the premises of which are the values already computed for them. It is called once per distinct step, so a sub-proof shared by many steps is computed once, which is what rebuilding a proof elsewhere wants. To end early, throw, in Except for instance.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[instance_reducible]
            instance Cvc.Untyped.Solver.Proof.instForInOfMonad {pc : Proof.Component} [Ω] {s : Solver} {m : Type → Type u_1} [Monad m] :
            ForIn m (s.Proof pc) (s.Proof pc)

            for step in p do … visits the distinct steps of p in the order fold enters them.

            break ends the loop.

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

            Questions about a proof #

            The number of distinct steps in p.

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

              How many distinct steps of p apply each rule, rules in the order they are first reached.

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

                The assumptions p leaves open, in the order they are first reached.

                These are the formulas of its ASSUME steps that no enclosing SCOPE discharges.

                A proof cvc5 answers for the full component leaves none open, its root scope discharging the assertions. Below that scope, they are the assertions the refutation actually uses.

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

                  The distinct steps of p that cvc5 does not justify, in the order they are first reached.

                  These are its TRUST and TRUST_THEORY_REWRITE steps.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Cvc.Untyped.Solver.Proofs.fold {pc : Proof.Component} [Ω] {s : Solver} (ps : s.Proofs pc) {m : Type → Type u_1} {σ : Type} [Monad m] (init : σ) (pre : s.Proof pc → s.ProofView pc → σ → m (FoldPre σ) := fun (x : s.Proof pc) (x_1 : s.ProofView pc) (s : σ) => pure (FoldPre.descend s)) (post : s.Proof pc → s.ProofView pc → σ → m (FoldPost σ) := fun (x : s.Proof pc) (x_1 : s.ProofView pc) (s : σ) => pure (FoldPost.continue s)) (revisit : Bool := false) :
                    m σ

                    Solver.Proof.fold over several proofs at once, left to right.

                    A step they share is visited once in all.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Cvc.Untyped.Solver.Proofs.foldUp {pc : Proof.Component} [Ω] {s : Solver} (ps : s.Proofs pc) {m : Type → Type u_1} {β : Type} [Monad m] (f : s.Proof pc → Proof.View β Term Term → m β) :
                      m (Array β)

                      Solver.Proof.foldUp over several proofs at once, answering each proof's value, in order.

                      A step they share is computed once in all.

                      Equations
                      Instances For