Documentation

Blaster.Smt.Env

Result of an Smt query.

Instances For
    Equations
    Instances For
      Equations
      Instances For
        def Blaster.Smt.logResult (r : Result) (isCTI : Bool := false) (indLabel : String := "") (cexLabel : String := "Counterexample") :
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Spawn a z3 process w.r.t. the provided solver options.

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

              Update translation cache with a := b.

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

                Return b if a := b is already in the translation cache. Otherwise, the following actions are performed:

                • execute b ← fun ()
                • update cache with a := b
                • return b
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Check if cancel token has been triggered and kill corresponding running Solver instance (if necessary).

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

                    Retrieve model output from h when a counterexample is generated. NOTE: A model output starts with "(" and ends with ")\n"

                    Equations
                    Instances For

                      Retrieve proof output for an unsat result. NOTE: A proof output starts with "(proof" and ends with ")\n\n".

                      Equations
                      Instances For

                        Retrieve error msg from 'h'. NOTE: An error msg starts with "(error" and ends with ")\n".

                        Equations
                        Instances For

                          Retrieve an eval output from h after execution (eval t) NOTE: An eval output may either correspond to a scalar value or to an inductive datatype one. In the latter case it's provided within parenthesis. The number of opening and closing parenthesis should tally to stop reading from h.

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

                              Push smt command c in the translation environment only when sOpts.dumpSmtLib is set

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

                                Return true when the smtProc has been initialized

                                Equations
                                Instances For

                                  Push smt command c in the translation environment only when sOpts.dumpSmtLib is set. The command is piped to the backend solver if the corresponding process has been created. An error is triggered when the checkSuccess flag is set and not success output is produced. NOTE: The checkSuccess is to be set only for Smt command that are NOT expected to produce any output.

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

                                    Same as trySubmitCommand! but with flag checkSuccess set to false.

                                    Equations
                                    Instances For

                                      Declare an inductive datatype in Smt lib with name nm and body decl.

                                      Equations
                                      Instances For

                                        Declare mutual inductive datatypes in Smt lib with names nms and bodies decls. An error is triggered if nms.size ≠ decls.size.

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

                                          Declare an uninterpreted function with name nm, arguments args and return type rt.

                                          Equations
                                          Instances For

                                            Define a function with name nm, parameters args, return type rt, body b with isRec flag set to false by default.

                                            Equations
                                            Instances For

                                              Define mutually recursive functions with declarations decls and bodies bs. An error is triggered if decls.size ≠ bs.size.

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

                                                Define a sort with name nm, optional parameters args and body b.

                                                Equations
                                                Instances For

                                                  Create an Smt symbol from a free variable v. If v already exists in the free variables cache return the same smt symbol. Otherwise:

                                                  • Increment the free variable index
                                                  • Insert v in cache
                                                  • return the smt symbol corresponding to the new index
                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For

                                                    Create an Smt term from a free variable.

                                                    Given s and smt symbol t and smt sort and optional assertFlag boolean value, perform the following:

                                                    • When assertFlag = some b:
                                                      • define smt predicate (define-fun s ((@x t)) Bool b)
                                                    • Otherwise:
                                                      • declare smt predicate (declare-fun s ((t)) Bool) Assume that s is defined as @is{xxx}
                                                    Equations
                                                    Instances For

                                                      Perform the following actions:

                                                      • Declare smt universal sort (declare-sort @@Type 0)
                                                      • Define smt predicate (define-fun @isType ((@x @@Type)) Bool true) Assume isTypeSym := @isType
                                                      Equations
                                                      Instances For

                                                        Perform the following actions:

                                                        • Declare Empty sort in Smt Lib
                                                        • Define smt predicate (define-fun @isEmpty ((@x Empty)) Bool false) Assume isEmptySym := @isEmpty
                                                        Equations
                                                        Instances For

                                                          Perform the following actions:

                                                          • Declare PEmpty sort in Smt Lib
                                                          • Define smt predicate (define-fun @isPEmpty ((@x PEmpty)) Bool false) Assume isPEmptySym := @isPEmpty
                                                          Equations
                                                          Instances For

                                                            Perform the following actions:

                                                            • Define Prop sort in Smt Lib, which is an alias to Bool Smt Sort
                                                            • Define smt predicate (define-fun @isProp ((@x Prop)) Bool true) Assume isPropSym := @isProp
                                                            Equations
                                                            Instances For

                                                              Perform the following actions:

                                                              • Define Nat sort in Smt Lib, which is an alias to Int Smt Sort
                                                              • Define smt predicate (define-fun @isNat ((@x Nat)) Bool (<= 0 @x)) to qualify quantifiers on Nat Assume isNatSym := @isNat
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                Define Nat.sub Smt function, i.e., @Nat.sub x y := (ite (< x y) 0 (- x y))

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

                                                                  Define Int.ediv Smt function, i.e., @Int.ediv x y := (ite (= 0 y) 0 (div x y))

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

                                                                    Define Int.emod Smt function, i.e., @Int.emod x y := (ite (= 0 y) x (mod x y))

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

                                                                      Define Int.tdiv Smt function, i.e., @Int.tdiv x y := (ite (= 0 y) 0 (ite (<= 0 x) (div x y) (- (div (- x) y))))

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

                                                                        Define Int.tmod Smt function, i.e., @Int.tmod x y := (ite (= 0 y) x (ite (<= 0 x) (mod x y) (- (mod (- x) y))))

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

                                                                          Define Int.fdiv Smt function, i.e., @Int.fdiv x y := (ite (= 0 y) 0 (ite (< y 0) (div (-x) (- y)) (div x y)))

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

                                                                            Define Int.fmod Smt function, i.e., @Int.fmod x y := (ite (= 0 y) x (ite (< y 0) (- (mod (- x) y)) (mod x y)))

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

                                                                              Define Int.pow Smt function as follows: (define-fun-rec @Int.pow ((@x Int)(@y Nat)) Int (ite (= 0 @y) 1 (* @x (@Int.pow @x (@Nat.sub @y 1)))))

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

                                                                                Define Nat.pow Smt function as follows: (define-fun-rec @Nat.pow ((@x Nat)(@y Nat)) Nat (ite (= 0 @y) 1 (* @x (@Nat.pow @x (@Nat.sub @y 1)))))

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

                                                                                  Define Int.toNat Smt function, i.e., Int.toNat x := (ite (<= 0 x) x else 0)

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

                                                                                    Try to retrieve to evaluate term t when a sat result is obtained and dump result to stdout. TODO: We need to define the Smt-lib syntax and term elaborator to parse produced value and generate the corresponding Lean representation. This will also be helpful when writing the test cases to validate the Smt-Lib translation. Do nothing if the Smt process is not defined.

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

                                                                                      Try to retrieve the model when a sat result is obtained and dump result to stdout. Do nothing when:

                                                                                      • No solver instance is defined
                                                                                      • Option solverOptions.generateCex is set to false TODO: We need to define the Smt-lib syntax and term elaborator to parse produced model and generate the corresponding Lean representation. This will also be helpful when writing the test cases to validate the Smt-Lib translation.
                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For
                                                                                        Equations
                                                                                        • One or more equations did not get rendered due to their size.
                                                                                        Instances For

                                                                                          Retrieve sat result from h. An error is triggered when an unexpected check-sat result is obtained. Function can be called only after a check-sat

                                                                                          Equations
                                                                                          Instances For

                                                                                            Check satisfiability of current Smt query and return the result. An error is triggered when an unexpected check-sat result is obtained. Return Undetermined when the Smt process is not defined.

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

                                                                                              Check satisfiability of current Smt query by assuming the provided terms and return the result. An error is triggered when an unexpected check-sat result is obtained. Return Undetermined when the Smt process is not defined.

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

                                                                                                Try to retrieve the proof artifact when a unsat result is obtained and dump result to stdout. TODO: We need to define the Smt-lib syntax and term elaborator to parse and reconstruct the proof in Lean. This will also be helpful when writing the test cases to validate the Smt-Lib translation. Do nothing if the Smt process is not defined.

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

                                                                                                  Try to terminate the Smt process. Do nothing if Smt process is not defined.

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

                                                                                                    Set Smt smt.pull-nested-quantifiers option to b.

                                                                                                    Equations
                                                                                                    Instances For

                                                                                                      Set Smt smt.case_split to n, with n ∈ [0..6].

                                                                                                      Equations
                                                                                                      Instances For

                                                                                                        Set Smt timeout when option is specified.

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

                                                                                                          Set the default Smt options, i.e.:

                                                                                                          • (set-option :print-success true)
                                                                                                          • (set-option :produce-models true)
                                                                                                          • (set-option :produce-proofs true)
                                                                                                          • (set-option :smt-pull-nested-quantifiers true)
                                                                                                          • (set-option :smt-mbqi true)
                                                                                                          • (set-option :auto_config false)
                                                                                                          • (set-option :smt.random-seed n) when n is provided in solver options
                                                                                                          • (set-option :smt.macro_finder true)
                                                                                                          Equations
                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                          Instances For

                                                                                                            Perform the following actions:

                                                                                                            • when option only-smt-lib is set to false:
                                                                                                              • Spawn the backend solver process and update TranslateEnv
                                                                                                              • set the default smt solver options by emitting the corresponding commands
                                                                                                            • when option only-smt-lib is set to true:
                                                                                                              • only add the solver options to the list of smt commands.
                                                                                                            Equations
                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                            Instances For