Generate an smt symbol from a given function name.
Equations
- Blaster.Smt.funNameToSmtSymbol funName = Blaster.Smt.mkNormalSymbol (toString "@" ++ toString funName)
Instances For
list of Lean operators expected to be fully applied at translation phase.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return true when e corresponds to one of the following:
e := Prop; ore := α₁ → ... → αₙ → Prop; Assume thatedoes not contain any let expression.
Equations
Instances For
Return true when indName corresponds to an inductive predicate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given f x₁ ... xₙ a function instance and sid a unique smt identifier for f x₁ ... xₙ,
add entry f x₁ ... xₙ := sid to funInstCache.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Same as updateFunInstCacheBase but accepts an SmtSymbol as argument and returns
the SmtQualifiedIdent instance added to funInstCache.
Equations
Instances For
Perform the following actions:
- Return
SimpleIdent "Nat.sub"when entryn := SimpleIdent "Nat.sub"exists infunInstCache - Otherwise:
- define Nat sort (if necessary)
- define Nat.sub Smt function (i.e., see
defineNatSub) - add entry
n := SimpleIdent "Nat.sub"tofunInstCache - return
SimpleIdent "Nat.sub"Assume thatn := Expr.const ``Nat.sub [].
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the following actions:
- Return
SimpleIdent "@Int.ediv"when entryf := SimpleIdent "@Int.ediv"exists infunInstCache - Otherwise:
- define @Int.ediv Smt function (i.e., see
defineIntEDiv) - add entry
f := SimpleIdent "@Int.ediv"tofunInstCache - add entry
f' := SimpleIdent "@Int.ediv"tofunInstCachewith: - f' := Expr.constNat.div _ iff := Expr.const ``Int.ediv _- f' := Expr.const@Int.ediv _ otherwise - return
SimpleIdent "@Int.ediv"Assume thatf := Expr.const ``Int.ediv []orf := Expr.const ``Nat.div [].
- define @Int.ediv Smt function (i.e., see
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Blaster.Smt.translateIntEDiv.toEDivAlias (Lean.Expr.const `Int.ediv us) = Blaster.Optimize.mkNatDivOp
- Blaster.Smt.translateIntEDiv.toEDivAlias (Lean.Expr.const `Nat.div us) = Blaster.Optimize.mkIntEDivOp
- Blaster.Smt.translateIntEDiv.toEDivAlias (Lean.Expr.const n us) = Blaster.Optimize.throwEnvError (Lean.toMessageData "toEDivAlias: unexpected div operator " ++ Lean.toMessageData n)
- Blaster.Smt.translateIntEDiv.toEDivAlias f = Blaster.Optimize.throwEnvError (Lean.toMessageData "toEDivAlias: name expression expected but got " ++ Lean.toMessageData (reprStr f))
Instances For
Perform the following actions:
- Return
SimpleIdent "@Int.emod"when entryf := SimpleIdent "@Int.emod"exists infunInstCache - Otherwise:
- define @Int.emod Smt function (i.e., see
defineIntEMod) - add entry
f := SimpleIdent "@Int.emod"tofunInstCache - add entry
f' := SimpleIdent "@Int.emod"tofunInstCachewith: - f' := Expr.constNat.mod _ iff := Expr.const ``Int.emod _- f' := Expr.const@Int.emod _ otherwise - return
SimpleIdent "@Int.emod"Assume thatf := Expr.const ``Int.emod []or f :=Expr.const ``Nat.mod []
- define @Int.emod Smt function (i.e., see
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Blaster.Smt.translateIntEMod.toEModAlias (Lean.Expr.const `Int.emod us) = Blaster.Optimize.mkNatModOp
- Blaster.Smt.translateIntEMod.toEModAlias (Lean.Expr.const `Nat.mod us) = Blaster.Optimize.mkIntEModOp
- Blaster.Smt.translateIntEMod.toEModAlias (Lean.Expr.const n us) = Blaster.Optimize.throwEnvError (Lean.toMessageData "toEModAlias: unexpected mod operator " ++ Lean.toMessageData n)
- Blaster.Smt.translateIntEMod.toEModAlias f = Blaster.Optimize.throwEnvError (Lean.toMessageData "toEModAlias: name expression expected but got " ++ Lean.toMessageData (reprStr f))
Instances For
Perform the following actions:
- Return
SimpleIdent "@Int.tdiv"when entryn := SimpleIdent "@Int.tdiv"exists infunInstCache - Otherwise:
- define @Int.tdiv Smt function (i.e., see
defineIntTDiv) - add entry
n := SimpleIdent "@Int.tdiv"tofunInstCache - return
SimpleIdent "@Int.tdiv"Assume thatn := Expr.const ``Int.tdiv [].
- define @Int.tdiv Smt function (i.e., see
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the following actions:
- Return
SimpleIdent "@Int.tmod"when entryn := SimpleIdent "@Int.tmod"exists infunInstCache - Otherwise:
- define @Int.tmod Smt function (i.e., see
defineIntTMod) - add entry
n := SimpleIdent "@Int.tmod"tofunInstCache - return
SimpleIdent "@Int.tmod"Assume thatn := Expr.const ``Int.tmod [].
- define @Int.tmod Smt function (i.e., see
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the following actions:
- Return
SimpleIdent "@Int.fdiv"when entryn := SimpleIdent "@Int.fdiv"exists infunInstCache - Otherwise:
- define @Int.fdiv Smt function (i.e., see
defineIntFDiv) - add entry
n := SimpleIdent "@Int.fdiv"tofunInstCache - return
SimpleIdent "@Int.fdiv"Assume thatn := Expr.const ``Int.fdiv [].
- define @Int.fdiv Smt function (i.e., see
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the following actions:
- Return
SimpleIdent "@Int.fmod"when entryn := SimpleIdent "@Int.fmod"exists infunInstCache - Otherwise:
- define @Int.fmod Smt function (i.e., see
defineIntFMod) - add entry
n := SimpleIdent "@Int.fmod"tofunInstCache - return
SimpleIdent "@Int.fmod"Assume thatn := Expr.const ``Int.fmod [].
- define @Int.fmod Smt function (i.e., see
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the following actions:
- Return
SimpleIdent "@Int.pow"when entryf := SimpleIdent "@Int.pow"exists infunInstCache - Otherwise:
- define Nat.sub function (if necessary)
- define @Int.pow Smt function (i.e., see
defineIntPow) - add entry
f := SimpleIdent "@Int.pow"tofunInstCache - return
SimpleIdent "@Int.pow"Assume thatf := Expr.const ``Int.pow []
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the following actions:
- Return
SimpleIdent "@Nat.pow"when entryf := SimpleIdent "@Nat.pow"exists infunInstCache - Otherwise:
- define Nat.sub function (if necessary)
- define @Nat.pow Smt function (i.e., see
defineNatPow) - add entry
f := SimpleIdent "@Nat.pow"tofunInstCache - return
SimpleIdent "@Nat.pow"Assume thatf :=Expr.const ``Nat.pow []`
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the following actions:
- Return
SimpleIdent "@Int.toNat"when entryn := SimpleIdent "@Int.toNat"exists infunInstCache - Otherwise:
- define Nat sort (if necessary)
- define @Int.toNat Smt function (i.e., see
defineInttoNat) - add entry
n := SimpleIdent "@Int.toNat"tofunInstCache - return
SimpleIdent "@Int.toNat"Assume thatn := Expr.const ``Int.toNat [].
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return stₙ when entry f := stₙ exists in funInstCache.
Otherwise:
- add entry
f := SimpleIdent stofunInstCache - return
SimpleIdent s
Equations
- Blaster.Smt.getOpaqueSmtEquivFun f s = do let __do_lift ← get match __do_lift.smtEnv.funInstCache.get? f with | none => Blaster.Smt.updateFunInstCache f s | some smtId => pure smtId
Instances For
Given f a name expression for which a corresponding smt operator exists and n
its corresponding name, and args the effective parameters for f,
perform the following actions:
- When
f := stₙexists infunInstCache- return stₙ
- When no entry for
fexists infunInstCache- add entry
f := SimpleIdent (smtSymbolFor f)tofunInstCache - define corresponding smt function only when
hasSmtDefinedOperator f - return
SimpleIdent (smtSymbolFor f)
- add entry
An error is triggered
- when
ncorresponds to one of the opaque functions:- Exists
- Blaster.decide'
- Iff
- Int.le
- Nat.beq
- Nat.ble
- Nat.pred
- Nat.le
- when
args.size == 0forLt.lt
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.translateOpaqueFun f `Eq args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.eqSymbol
- Blaster.Smt.translateOpaqueFun f `BEq.beq args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.eqSymbol
- Blaster.Smt.translateOpaqueFun f `And args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.andSymbol
- Blaster.Smt.translateOpaqueFun f `Bool.and args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.andSymbol
- Blaster.Smt.translateOpaqueFun f `Or args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.orSymbol
- Blaster.Smt.translateOpaqueFun f `Bool.or args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.orSymbol
- Blaster.Smt.translateOpaqueFun f `Not args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.notSymbol
- Blaster.Smt.translateOpaqueFun f `Bool.not args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.notSymbol
- Blaster.Smt.translateOpaqueFun f `Blaster.dite' args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.iteSymbol
- Blaster.Smt.translateOpaqueFun f `Int.add args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.addSymbol
- Blaster.Smt.translateOpaqueFun f `Nat.add args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.addSymbol
- Blaster.Smt.translateOpaqueFun f `Int.neg args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.subSymbol
- Blaster.Smt.translateOpaqueFun f `Int.mul args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.mulSymbol
- Blaster.Smt.translateOpaqueFun f `Nat.mul args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.mulSymbol
- Blaster.Smt.translateOpaqueFun f `Int.toNat args = Blaster.Smt.translateInttoNat f
- Blaster.Smt.translateOpaqueFun f `Int.tdiv args = Blaster.Smt.translateIntTDiv f
- Blaster.Smt.translateOpaqueFun f `Int.tmod args = Blaster.Smt.translateIntTMod f
- Blaster.Smt.translateOpaqueFun f `Int.fdiv args = Blaster.Smt.translateIntFDiv f
- Blaster.Smt.translateOpaqueFun f `Int.fmod args = Blaster.Smt.translateIntFMod f
- Blaster.Smt.translateOpaqueFun f `Int.ediv args = Blaster.Smt.translateIntEDiv f
- Blaster.Smt.translateOpaqueFun f `Nat.div args = Blaster.Smt.translateIntEDiv f
- Blaster.Smt.translateOpaqueFun f `Int.emod args = Blaster.Smt.translateIntEMod f
- Blaster.Smt.translateOpaqueFun f `Nat.mod args = Blaster.Smt.translateIntEMod f
- Blaster.Smt.translateOpaqueFun f `Int.pow args = Blaster.Smt.translateIntPow f
- Blaster.Smt.translateOpaqueFun f `Nat.pow args = Blaster.Smt.translateNatPow f
- Blaster.Smt.translateOpaqueFun f `LE.le args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.leqSymbol
- Blaster.Smt.translateOpaqueFun f `Nat.ble args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.leqSymbol
- Blaster.Smt.translateOpaqueFun f `Nat.sub args = Blaster.Smt.translateNatSub f
- Blaster.Smt.translateOpaqueFun f `String.append args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.strAppendSymbol
- Blaster.Smt.translateOpaqueFun f `String.length args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.strLengthSymbol
- Blaster.Smt.translateOpaqueFun f `String.replace args = Blaster.Smt.getOpaqueSmtEquivFun f Blaster.Smt.strReplaceAllSymbol
- Blaster.Smt.translateOpaqueFun f n args = Blaster.Optimize.throwEnvError (Lean.toMessageData "translateOpaqueFun: unexpected opaque operator " ++ Lean.toMessageData n)
Instances For
Helper function for createAppN
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Blaster.Smt.createAppNAux.genUnapplied isHOF (Sum.inl qi) = if isHOF = true then pure (Blaster.Smt.SmtTerm.SmtIdent qi) else pure (Blaster.Smt.SmtTerm.SmtIdent qi)
- Blaster.Smt.createAppNAux.genUnapplied isHOF (Sum.inr st) = if isHOF = true then pure st else Blaster.Optimize.throwEnvError (Lean.toMessageData "genUnapplied: SmtQualifiedIdent expected !!!")
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a function application f x₀ ... xₙ and s the corresponding generated
smt identifier/term for f, perform the following:
- When
n = 0 ∨ ∀ i ∈ [0..n], ¬ isExplicit xᵢ(i.e., instantiated polymorphic function passed as argument):- When isHOF:
- When
isSmtQualifiedIdent s- return
.SmtIdent s
- return
- Otherwise (i.e., s is an Smt term, case when f corresponds to a function in a ctor argument)
- return
s
- return
- When
- Otherwise:
- When
isSmtQualifiedIdent s- return
asArraySmt s
- return
- Otherwise (i.e., only a defined function expected)
- return ⊥
- When
- When isHOF:
- When
∃ i ∈ [0..n], isExplicit xᵢ,let A := [x₀,..., xₙ] let B := [termTranslator A[i] | i ∈ [0..n] ∧ isExplicit A[i]]- When isHOF:
- When
isSmtQualifiedIdent s- return
selectSmt (.SmtIdent s) B
- return
- Otherwise (i;e., case when f corresponds to a function in a ctor argument)
- return
selectSmt s B
- return
- When
- Otherwise:
- When
isSmtQualifiedIdent s- return
mkSmtAppN s B
- return
- Otherwise (i.e., only a defined function expected)
- return ⊥
- When
- When isHOF:
Equations
- Blaster.Smt.createAppN f s args termTranslator isHOF = do let pInfo ← Blaster.Optimize.getFunEnvInfo f Blaster.Smt.createAppNAux pInfo s args termTranslator isHOF
Instances For
Given t corresponding the type of a function/lambda parameter:
- return
translateType termTranslator t optionsForFunLambdaParamAn error is triggered iftcorresponds to the type of an implicit argument.
Equations
- Blaster.Smt.translateFunLambdaParamType t termTranslator = Blaster.Smt.translateType termTranslator t Blaster.Smt.optionsForFunLambdaParam
Instances For
- funDecls : Array SmtFunDecl
- isRec : Bool
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given f := Expr.const n _ corresponding to a function name and
params its implicit parameter infos, perform the following actions:
let instanceArgs := Array.filter (λ p => p.isInstance) params
- When instanceArgs.isEmpty:
- instName := funNameToSmtSymbol n
- add entry
f := SimpleIdent instNametofunInstCache - return
SimpleIdent instName
- When ¬ instanceArgs.isEmpty:
- instName := funNameToSmtSymbol (n ++ (← mkFreshId))
- instApp ← getInstApp f params
- add entry
instApp := SimpleIdent instNametofunInstCache - return
SimpleIdent instNameAn error is triggered whenfis not a named expression.
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.generateFunInst f params = Blaster.Optimize.throwEnvError (Lean.toMessageData "generateFunInst: name expression expected but got " ++ Lean.toMessageData (reprStr f))
Instances For
Given a recursive function application f x₁ ... xₙ, perform the following:
let insApp := getInstApp f (← getImplicitParameters f x₁ ... xₙ)
- When ∃
instApp := smtId∈funInstCache- return
createApp f smtId #[x₁ ... xₙ] termTranslator
- return
- Otherwise,
- generate function definition for
fat the Smt level - smtId ← generateFunInst f (← getImplicitParameters f x₁ ... xₙ)
- return
createApp f smtId #[x₁ ... xₙ] termTranslator
- generate function definition for
Assume that f is a recursive function not tagged as opaque.
An error is triggered when
fis not a name expression.- No entry in
recFunInstCacheexists forf
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
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.translateRecFun.replaceGenericRecFun f params e = none
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return true only when n corresponds to a function/constructor name
expected to be eliminated during optimization phase.
Equations
- Blaster.Smt.isForbiddenConst `Decidable.decide = true
- Blaster.Smt.isForbiddenConst `ite = true
- Blaster.Smt.isForbiddenConst `dite = true
- Blaster.Smt.isForbiddenConst `Iff = true
- Blaster.Smt.isForbiddenConst `Int.negSucc = true
- Blaster.Smt.isForbiddenConst `Int.le = true
- Blaster.Smt.isForbiddenConst `Nat.zero = true
- Blaster.Smt.isForbiddenConst `Nat.succ = true
- Blaster.Smt.isForbiddenConst `Nat.pred = true
- Blaster.Smt.isForbiddenConst `Nat.beq = true
- Blaster.Smt.isForbiddenConst `Nat.ble = true
- Blaster.Smt.isForbiddenConst `Nat.le = true
- Blaster.Smt.isForbiddenConst n = false
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given t := ∀ α₀ → ∀ α₁ ... → αₙ, infer the instanitated type w.r.t. params such that:
- let S := [ αᵢ | i ∈ [0..n] ∧ ¬ params[i].isInstance ]
- let R := [ params[i].effectiveArg | i ∈ [0..n] ∧ ¬ params[i].isInstance ]
- let k := S.size-1
- let [α'₀, ..., α'ₚ] := [ αᵢ [S[0]/R[0]] ... [S[k]/R[k]] | i ∈ [0..n] ∧ params[i].isInstance ]
- return
∀ α'₀ → ∀ α'₁ ... → α'ₚTODO: change function to pure tail rec call using stack-based approach
Equations
- Blaster.Smt.inferUndeclFunType t params = Blaster.Smt.inferUndeclFunType.visit params 0 t
Instances For
Given f corresponding to either an undeclared class function, an axiom function or an opaque function
params its corresponding implicit/explicit parameters and s its corresponding smt symbol,
perform the following:
- Let
∀ α₀ → ∀ α₁ ... → αₙ:= inferUndecFunType (← getFunEnvInfo f).type params - declare smt function
declare-fun s ((st₀) .. (stₙ₋₁)) stₙ) - assert the following proposition to constraint the codomain value:
(assert (forall ((@x₀ st₀) ... (@xₙ₋₁ stₙ₋₁)) (! (@isTypeₙ (s @x₁ ... @xₙ₋₁)) :pattern ((s @x₁ ... @xₙ₋₁))) :qid s_cstr)
where ∀ i ∈ [0..n], αᵢ translates to Smt type stᵢ
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given e := Expr.const n l,
- When
n := false- return
BoolTerm false
- return
- When
n := False- return
BoolTerm false
- return
- When
n := true- return
BoolTerm true
- return
- When
n := True- return
BoolTerm true
- return
- When
n := Int.ofNat- return
termTranslator (← etaExpand e)
- return
- When
isInductiveTypeExpr e- return ⊥
- When
isForbiddenUnappliedConst n- return ⊥
- When
isMatchExpr e- return ⊥
- When
nis a constructor with implicit arguments- return ⊥
- When
nis a nullary constructor- return
SmtIdent (.QualifiedIdent n (translateType termTranslator Type(n)))
- return
- When
nis a parameterized constructor- return
termTranslator (← etaExpand e)
- return
- When
hasImplicitArgs e- return ⊥
- When
n∈ opaqueFuns ∨ isRecursiveFunn- return
termTranslator (← etaExpand e)
- return
- When
isTheorem n∧¬ hasSorryTheorem e∧ ¬ Type(e).isForAll- return termTranslator (← optimizeExpr' Type(e))
- When
isAxiom n ∨ some ConstantInfo.opaqueInfo _ ← getConstEnvInfo n- When n := s ∈ axiomMap:
- return
smtSimpleVarId s
- return
- Otherwise:
- When
isFunType Type(e)- return
termTranslator (← etaExpand e)
- return
- Otherwise:
- Let s = nameToSmtSymbol n
- add
n := sto axiomMap - Let t' ← removeTypeAbbrev Type(e)
- Let st ← translateTypeAux termTranslator t'
- declare smt symbol
(declare-const s st) - Let pterm ← createPredQualifierApp s t'
- assert term
(assert pterm) - return
smtSimpleVarId s
- When
- When n := s ∈ axiomMap:
- Otherwise
- return ⊥
An error is triggered when
eis not a name expression.
- return ⊥
An error is triggered when
NOTE: This function cannot be called on fun name expression
(i.e., f x₁ ... xₙ, where e := f and f is a partially or totally applied function).
It can only be applied on functions passed as arguments.
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.translateConst (Lean.Expr.const `Bool.false us) termTranslator = pure Blaster.Smt.falseSmt
- Blaster.Smt.translateConst (Lean.Expr.const `False us) termTranslator = pure Blaster.Smt.falseSmt
- Blaster.Smt.translateConst (Lean.Expr.const `Bool.true us) termTranslator = pure Blaster.Smt.trueSmt
- Blaster.Smt.translateConst (Lean.Expr.const `True us) termTranslator = pure Blaster.Smt.trueSmt
- Blaster.Smt.translateConst e termTranslator = Blaster.Optimize.throwEnvError (Lean.toMessageData "translateConst: name expression expected but got " ++ Lean.toMessageData (reprStr e))
Instances For
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
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
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Blaster.Smt.translateConst.isForbiddenUnappliedConst `Exists = Blaster.Smt.isForbiddenConst `Exists
- Blaster.Smt.translateConst.isForbiddenUnappliedConst `Blaster.decide' = Blaster.Smt.isForbiddenConst `Blaster.decide'
- Blaster.Smt.translateConst.isForbiddenUnappliedConst `Blaster.dite' = Blaster.Smt.isForbiddenConst `Blaster.dite'
- Blaster.Smt.translateConst.isForbiddenUnappliedConst n = Blaster.Smt.isForbiddenConst n
Instances For
Translate Application TODO: UPDATE
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.
- Blaster.Smt.translateApp.translateEq? e termTranslator f n args = pure none
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.translateApp.translateDITE? termTranslator f n args = pure none
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.translateApp.translateOfNat? termTranslator n args = pure none
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.translateApp.translateDecide? termTranslator n args = pure none
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Smt.translateApp.translateRelational? e termTranslator f n args = pure none
Instances For
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.
- Blaster.Smt.translateApp.translateExists? termTranslator n args = pure none
Instances For
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
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
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
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
Given e := λ (x₁ : t₁) → λ (xₙ : tₙ) => b, perform the following:
- let V := [ v | v ∈ getFVarsInExpr b ∧ ¬ isType v.type ∧ ¬ isClassConstraintExpr v.type ∧ ¬ isTopLevelFVar v ]
- let A := [x₁, ..., xₙ]
- let (x₁, st₁) ... (xₘ, stₘ) := [(A[i], translateFunLambdaParamType tᵢ termTranslator) | i ∈ [0..n] ∧ isExplicit A[i]]
- let rt ← translateFunLambdaParamType (← inferTypEnv b) termTranslator
- let n ← mkFreshId
- let FunArrowType := ArrowTN st₁ ... stₘ rt
- let decl ← generateFunInstDeclAux (← inferTypeEnv e) FunArrowType
- let some @apply{k} := decl.applyInstName
- let sb := termTranslator b
- When V = ∅
- declare smt function
(declare-const @lambda{n} FunArrowType) - assert the following proposition to properly constrain @lambda{n}:
(assert (forall ((x₁ st₁) ... (xₘ stₘ)) (! (= (@apply{k} @lambda{n} x₁ ... xₘ) sb) :pattern ((@apply{k} @lambda{n} x₁ ... xₘ)) :qid @lambda{n]_def_cstr))) - return
smtSimpleVarId @lambda{n}
- declare smt function
- When V ≠ ∅
- let (y₁, yt₁) ... (yₖ, ytₖ) := [(V[i], translateFunLambdaParamType V[i].type termTranslator) | i ∈ [0..V.size-1]]
- let GlobalArrowType := ArrowTN yt₁ ... ytₖ FunArrowType
- let [v₁, ..., vₖ] = V
- let globalType ← ∀ v₁ → ... ∀ vₖ → outParam (← inferTypeEnv e)
- let globalDecl ← generateFunInstDeclAux globalType GlobalArrowType
- let some @apply{n} := globalDecl.applyInstName
- declare smt function
(declare-const @global_lambda{n} GlobalArrowType) - assert the following proposition to properly constrain @global_lambda{n}!
(assert (forall ((y₁, yt₁) ... (yₖ, ytₖ) (x₁, st₁) ... (xₘ, stₘ)) (! (= (@apply{k} (@apply{n} @global_lambda{n} y₁ ... yₖ) x₁ ... xₘ) sb) :pattern ((@apply{k} (@apply{n} @global_lambda{n} y₁ ... yₖ) x₁ ... xₘ)) :qid @global_lambda{n}_def_cstr)))
- return
(@apply{n} @global_lambda{n} y₁ ... yₖ)
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
Given n a projection name, idx a projection and p the projection application term,
perform the following:
- When
nis not an inductive datatype (i.e., structure definition)- return ⊥
- When
nhas more than one ctorc(i.e., structure only has one defined ctor with each field as arguments)- return ⊥
- Otherwise:
- return smt term application
(c.idx+1 p)
- return smt term application
Equations
- One or more equations did not get rendered due to their size.