Equations
- Blaster.Smt.instReprResult = { reprPrec := Blaster.Smt.instReprResult.repr }
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.instReprResult.repr Blaster.Smt.Result.Valid prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Blaster.Smt.Result.Valid")).group prec✝
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Blaster.Smt.blankRef = do let pos ← Lean.getRefPos pure (Lean.Syntax.atom (Lean.SourceInfo.original "".toSubstring pos " ".toSubstring pos) "")
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
- Blaster.Smt.getOutputModel h proof = Blaster.Smt.getOutputModel.loop h proof ""
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
- Blaster.Smt.getOutputEval.tallyParenthesis s tally = String.foldr (fun (c : Char) (acc : Int) => match c with | '(' => acc + 1 | ')' => acc - 1 | x => acc) tally s
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
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
- Blaster.Smt.declareFun nm args rt = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.declareFun nm args rt)
Instances For
Define a function with name nm, parameters args, return type rt, body b with
isRec flag set to false by default.
Equations
- Blaster.Smt.defineFun nm args rt b isRec = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.defineFun isRec nm args rt b)
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
Declare a sort with name nm and arity n.
Equations
Instances For
Define a sort with name nm, optional parameters args and body b.
Equations
- Blaster.Smt.defineSort nm args b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.defineSort nm args b)
Instances For
Assert a proposition p.
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
vin 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.
Equations
- Blaster.Smt.fvarIdToSmtTerm v = do let __do_lift ← Blaster.Smt.fvarIdToSmtSymbol v pure (Blaster.Smt.smtSimpleVarId __do_lift)
Instances For
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)
- define smt predicate
- Otherwise:
- declare smt predicate
(declare-fun s ((t)) Bool)Assume thatsis defined as@is{xxx}
- declare smt predicate
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.definePredQualifier s t none = Blaster.Smt.declareFun s #[t] Blaster.Smt.boolSort
Instances For
Perform the following actions:
- Declare smt universal sort
(declare-sort @@Type 0) - Define smt predicate
(define-fun @isType ((@x @@Type)) Bool true)AssumeisTypeSym := @isType
Equations
- Blaster.Smt.defineTypeSort isTypeSym = do Blaster.Smt.declareSort Blaster.Smt.typeSymbol 0 Blaster.Smt.definePredQualifier isTypeSym Blaster.Smt.typeSort (some true)
Instances For
Perform the following actions:
- Declare Empty sort in Smt Lib
- Define smt predicate
(define-fun @isEmpty ((@x Empty)) Bool false)AssumeisEmptySym := @isEmpty
Equations
- Blaster.Smt.defineEmptySort isEmptySym = do Blaster.Smt.declareSort Blaster.Smt.emptySymbol 0 Blaster.Smt.definePredQualifier isEmptySym Blaster.Smt.emptySort (some false)
Instances For
Perform the following actions:
- Declare PEmpty sort in Smt Lib
- Define smt predicate
(define-fun @isPEmpty ((@x PEmpty)) Bool false)AssumeisPEmptySym := @isPEmpty
Equations
- Blaster.Smt.definePEmptySort isPEmptySym = do Blaster.Smt.declareSort Blaster.Smt.pemptySymbol 0 Blaster.Smt.definePredQualifier isPEmptySym Blaster.Smt.pemptySort (some false)
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)AssumeisPropSym := @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 AssumeisNatSym := @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
falseTODO: 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
- Blaster.Smt.getModel.getVarValue v = do let __do_lift ← Blaster.Smt.evalTerm (Blaster.Smt.smtSimpleVarId v.fst) pure (toString v.snd ++ toString ": " ++ toString __do_lift)
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
- Blaster.Smt.getSatResult p = do let res ← liftM (IO.FS.Handle.getLine p.stdout).asTask Blaster.Smt.getSatResult.waitForResult res
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 the Smt logic to ALL.
Equations
Instances For
Set Smt produce-proofs option to b.
Equations
- Blaster.Smt.setProduceProofs b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":produce-proofs" (toString b))
Instances For
Set Smt produce-models option to b.
Equations
- Blaster.Smt.setProduceModels b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":produce-models" (toString b))
Instances For
Set Smt smt.mbqi option to b.
Equations
- Blaster.Smt.setMbqi b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":smt.mbqi" (toString b))
Instances For
Set Smt smt.pull-nested-quantifiers option to b.
Equations
- Blaster.Smt.setPullNestedQuantifiers b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":smt.pull-nested-quantifiers" (toString b))
Instances For
Set Smt print-success option to b.
Equations
- Blaster.Smt.setPrintSuccess b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":print-success" (toString b))
Instances For
Set Smt smt.random-seed option to n or none.
Equations
- Blaster.Smt.setRandomSeed (some idx) = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":smt.random-seed" (toString idx))
- Blaster.Smt.setRandomSeed none = pure ()
Instances For
Set Smt auto_config option to b.
Equations
- Blaster.Smt.setAutoConfig b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":auto_config" (toString b))
Instances For
Set Smt smt.case_split to n, with n ∈ [0..6].
Equations
- Blaster.Smt.setCaseSplit n = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":smt.case_split" (toString n))
Instances For
Set Smt smt.qi.eager_threshold to n.
Equations
- Blaster.Smt.setQiEagerThreshold n = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":smt.qi.eager_threshold" (toString n))
Instances For
Set Smt smt.delay_units to b.
Equations
- Blaster.Smt.setDelayUnits b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":smt.delay_units" (toString b))
Instances For
Set Smt smt.macro_finder option to b.
Equations
- Blaster.Smt.setMacroFinder b = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":smt.macro_finder" (toString b))
Instances For
Set Smt smt.relevancy option to i.
Equations
- Blaster.Smt.setRelevancy n = Blaster.Smt.trySubmitCommand! (Blaster.Smt.SmtCommand.setOption ":smt.relevancy" (toString n))
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
nis 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-libis set tofalse:- Spawn the backend solver process and update TranslateEnv
- set the default smt solver options by emitting the corresponding commands
- when option
only-smt-libis set totrue:- only add the solver options to the list of smt commands.
Equations
- One or more equations did not get rendered due to their size.