Documentation

Blaster.Smt.Translate.Quantifier

Removes an occurrence of type abbreviation in type expression t

Equations
Instances For

    Generate an smt symbol from a given Name.

    Equations
    Instances For

      Generate a smt symbol for a free variable id corresponding to a sort name (e.g., α : Type) s.t.:

      • return smt symbol "@" ++ v.getUserName ++ v.name when unique is set to true
      • return smt symbol "@" ++ v.getUserName otherwise.
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Generate an smt symbol from a given inductive type name.

        Equations
        Instances For

          Return some b if e := mkAnnotation __solver.ctorSelector b'`.

          Equations
          Instances For

            Return true if e := mkAnnotation _solver.ctorSelector b'`.

            Equations
            Instances For

              Given ctor a constructor name and idx corresponding to the index for one of the ctor's effective parameters, create the ctor selector symbol ctor.idx

              Equations
              Instances For

                Given ctor a constructor name and idx corresponding to the index for one of the ctor's arguments and arg the current ctor arg and t its corresponding type, perform the following:

                • add {ctor}.idx := ← getFunEnvInfo arg to funCtorCache when isFunType t
                • create expression ctor.idx x and tag it as a ctor selector.
                • create the corresponding smt term
                • return both as result The tag is used during translation.
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Given ctor a constructor name and an smt term s, create the smt term application is-ctor s.

                  Equations
                  Instances For

                    Given ctor a constructor name, create the smt term is-ctor x.

                    Equations
                    Instances For

                      Return s when nbArity := s exists in arrowTypeArities. Otherwise, perform the following:

                      • let s := @@ArrowT{nbArity}
                      • Add entry nbArity := s in arrowTypeArities
                      • declare sort (declare-sort s nbArity)
                      • return s
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Define smt universal sort @@Type and its corresponding predicate qualified whenever flag typeUniverse is not set. Do nothing otherwise. Assume isTypeSym := @isType

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

                          Update sort cache with v.

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

                            Return vstrₙ when entry v := vstrₙ exists in sortCache, otherwise, perform the following:

                            • vstr := "@" ++ v.getUserName ++ v.name.
                            • add define-sort "vstr" () @@Type to the Smt context
                            • add entry v := vstr to sortCache
                            • return vstr
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Add an inductive datatype name to the visited inductive datatype cache.

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

                                Return true when indName is already in the visited inductive datatype cache (i.e., indTypeCache)

                                Equations
                                Instances For

                                  Given d corresponding to a inductive datatype name expression, or an instantiated polymorphic inductive datatype, or a function instance declaration and n a unique smt identifier generated for d and instSort the instantiated Smt sort for d, perform the following:

                                  • add entry d := {instName := "@is{n}", instSort, applyInstName} in indTypeInstCache
                                  • return {instName := "@is{n}", instSort, applyInstName}

                                  with applyInstName set to none for inductive datatype and set to some @apply{uniq_xxx}. See function generateFunInstDeclAux.

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

                                    Same as updateIndInstCacheAux but return value is discarded.

                                    Equations
                                    Instances For

                                      Return true if v is tagged as a top level free variable.

                                      Equations
                                      Instances For

                                        Perform the following:

                                        • add v to quantifierFvars cache
                                        • add v to topLevelVars only when topLevel is set to true and ¬ isType (← inferTypeEnv (mkFVar v)).
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          Return true if v is in the quantified fvars cache.

                                          Equations
                                          Instances For

                                            Return true when an entry exists for v in inPatternMatching.

                                            Equations
                                            Instances For

                                              Return an Smt Array sort when args.size > 1. Otherwise return args[0]!. An error is triggered when args.size < 1.

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

                                                Given n corresponding to the name of an inductive datatype, and x₀ ... xₖ the parameters instantiating the inductive datatype, perform the following actions:

                                                • When k > 0: let A := [x₀, ..., xₖ] let B := [typeTranslator A[i] | i ∈ [0..k] ∧ ¬ isClassConstraintExpr (← inferTypeEnv A[i])]
                                                  • return ParamSort (indNameToSmtSymbol n) B
                                                • When k = 0:
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  Given arguments x₀ ... xₙ perform the following: let A := [x₀, ..., xₙ] let V := {α | i ∈ [0..n] ∧ α ∈ getFVarsInExpr A[i] ∧ isGenericParam A[i]} return [α | α ∈ V]

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

                                                    Given an inductive datatype instance t x₀ ... xₙ, perform the following:

                                                    • When ∀ i ∈ [0..n], ¬ isGenericParam xᵢ,
                                                      • return t x₀ ... xₙ
                                                    • When ∃ i ∈ [0..n], isGenericParam xᵢ, let A := [x₀, ..., xₙ] let V := [α | i ∈ [0..n] ∧ α ∈ getFVarsInExpr A[i] ∧ isGenericParam A[i] ] let [b₀ ... bₘ ] := V
                                                      • return λ b₀ → .. → bₘ → t x₀ ... xₙ
                                                    Equations
                                                    Instances For

                                                      Given t := ∀ α₀ → ∀ α₁ ... → αₙ returns #[α₀, α₁ ..., αₙ]. Assumes that t no more contains any class constraints (see function removeClassConstraintsInFunType).

                                                      Equations
                                                      Instances For

                                                        Given t := ∀ α₀ → ∀ α₁ ... → αₙ, perform the following:

                                                        • let A := [αᵢ | i ∈ [0..n-1], isClassConstraintExpr αᵢ]
                                                        • let [α'₀ ... α'ₚ] := A
                                                        • return ∀ α'₀ → α'₁ → ... → α'ₚ → αₙ`
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For

                                                          Given t := Expr.const n _ corresponding to an inductive datatype name and args the parameters instantiating the inductive datatype (if any), perform the following actions:

                                                          • When args.size > 0:
                                                            • instName := nameToSmtSymbol (n ++ (← mkFreshId)) (i.e., generate a unique name for instance)
                                                            • instSort ← generateInstType n args typeTranslator
                                                            • instApp ← getIndInst t args
                                                            • add entry instApp := {@is{instName}, instSort} to indTypeInstCache
                                                            • When declarePredicate:
                                                              • When assertFlag := some b:
                                                                • define smt predicate (define-fun @is{instName} ((@x instSort)) Bool b)
                                                              • Otherwise:
                                                                • declare smt predicate (declare-fun @is{instName} ((instSort)) Bool)
                                                            • return {instName, instSort}
                                                          • When args.size = 0:
                                                            • instName := nameToSmtSymbol n
                                                            • instSort ← generateInstType n args typeTranslator
                                                            • add entry t := {@is{instName}, instSort} to indTypeInstCache
                                                            • When declarePredicate:
                                                              • When assertFlag := some b:
                                                                • define smt predicate (define-fun @is{instName} ((@x instSort)) Bool b)
                                                              • Otherwise:
                                                                • declare smt predicate (declare-fun @is{instName} ((instSort)) Bool)
                                                            • return {instName, instSort} Assumes that t corresponds to the name of an inductive datatype.
                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For

                                                            Given t := ∀ α₀ → ∀ α₁ ... → αₙ, perform the following: Let A := [αᵢ | i ∈ [0..n-1]]

                                                            • When ∀ i ∈ [0..n], ¬ isGenericParam A[i],
                                                              • return t
                                                            • When ∃ i ∈ [0..n], isGenericParam A[i], let V := {v | i ∈ [0..n] ∧ v ∈ getFVarsInExpr A[i] ∧ isGenericParam A[i]} let B := [v | v ∈ V] ++ [A[i] | i ∈ [0..n] ∧ isGenericParam A[i]] let [b₀ ... bₘ ] := B let [α'₀ ... α'ₚ] := A
                                                              • return λ b₀ → .. → bₘ → ∀ α'₀ → α'₁ → ... → α'ₚ → αₙ Assumes that t does not have any implicit types (i.e., removeClassConstraintsInFunType called)
                                                            Equations
                                                            Instances For

                                                              Given t := ∀ α₀ → ∀ α₁ ... → αₙ, execute k t', with t' obtained as follows:

                                                              • let [α'₀ ... α'ₚ] := [αᵢ | i ∈ [0..n-1], isExplicit αᵢ]
                                                              • t' := ∀ α'₀ → α'₁ → ... → α'ₚ → αₙ`
                                                              • with free variables created for implicit arguments.
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                Return decl.instName when t := decl exists in indTypeInstCache. Otherwise none. 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.
                                                                  Instances For

                                                                    Return n only when entry t := decl exists in indTypeInstCache and decl.applyInstName := some n. An error is triggered when:

                                                                    • no entry exist for t
                                                                    • decl.applyInstName is set to none.
                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For

                                                                      Given st an smt term and t its corresponding type expression, perform the following:

                                                                      • retrieve predicate qualifier name instName for t
                                                                      • return smt application (instName v) An error is triggered if the predicate qualifier name for t does not exists. Assume that there is no type abbreviation in t, i.e., call to removeTypeAbbrev has been applied.
                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For

                                                                        Given t := α₁ → α₂ ... → αₙ and st its corresponding smt representation (i.e., ArrowTN sα₁ sα₂ sαₙ), perform the following action:

                                                                        • let funInst ← getFunInstDecl t
                                                                        • When funInst := {@is{instName}, st, applyInstName} ∈ indTypeInstCache
                                                                          • return {@is{instName}, st, applyInstName}
                                                                        • Otherwise:
                                                                          • let n ← mkFreshId
                                                                          • instName ← (Fun ++ n) (i.e., generate a unique name for function instance)
                                                                          • add entry t := {@is{instName}, st, applyInstName := some @apply{n}} to indTypeInstCache
                                                                          • declare smt predicate (declare-fun @is{instName} ((instSort)) Bool)
                                                                          • declare apply function (declare-fun @apply{n} (st sα₁ ... sαₙ₋₁) sαₙ)
                                                                          • assert the following propositions to specify congruence, extensionality and codomain values constraints:
                                                                            • (assert (forall ((@f (ArrowTN sα₁ sα₂ sαₙ))(@x₁ sα₁) ... (@xₙ₋₁ sαₙ₋₁) (@y₁ sα₁) ... (@yₙ₋₁ sαₙ₋₁)) (! (=> (= @x₁ @y₁) (=> (= @x₂ @y₂) ... (=> (= @xₙ₋₁ @yₙ₋₁) (= (@apply{n} @f @x₁ ... @xₙ₋₁) (@apply{n} @f @y₁ ... @yₙ₋₁))))) :pattern ((@apply{n} @f @x₁ ... @xₙ₋₁) (@apply{n} @f @y₁ ... @yₙ₋₁) (= @x₁ @y₁) ... (= @xₙ₋₁ @yₙ₋₁)) :qid @apply{n}_congr_args)))

                                                                            • (assert (forall ((@f (ArrowTN sα₁ sα₂ sαₙ)) (@g (ArrowTN sα₁ sα₂ sαₙ)) (@x₁ sα₁) ... (@xₙ₋₁ sαₙ₋₁)) (! (=> (= @f @g) (= (@apply{n} @f @x₁ ... @xₙ₋₁) (@apply{n} @g @x₁ ... @xₙ₋₁))) :pattern ((@apply{n} @f @x₁ ... @xₙ₋₁) (@apply{n} @g @x₁ ... @xₙ₋₁) (= @f @g)) :qid @apply{n}_congr_fun)))

                                                                            • (assert (forall ((@f (ArrowTN sα₁ sα₂ sαₙ)) (@g (ArrowTN sα₁ sα₂ sαₙ)) (@x₁ sα₁) ... (@xₙ₋₁ sαₙ₋₁)) (! (=> (= (@apply{n} @f @x₁ ... @xₙ₋₁) (@apply{n} @g @x₁ ... @xₙ₋₁)) (= @f @g)) :pattern (= (@apply{n} @f @x₁ ... @xₙ₋₁) (@apply{n} @g @x₁ ... @xₙ₋₁))) :qid @apply{n}_ext_fun)))

                                                                            • (assert (forall ((@f (ArrowTN sα₁ sα₂ ... αₙ))) (! (= (forall ((@x₁ sα₁) ... (@xₙ₋₁ sαₙ₋₁)) (@isTypeₙ (@apply{n} @f @x₁ ... @xₙ₋₁))) (@is{instName} @f) ) :pattern ( (@is{instName} @f)) :qid @isFun{v}_cstr)))

                                                                            • with ∀ i ∈ [1..n] = s

                                                                          • return {@is{instName}, st}
                                                                        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 t := Expr.sort _ perform the following actions only when no entry for t exists in indTypeInstCache:

                                                                            • When t := Expr.sort .zero

                                                                              • add entry t := {@isProp, propSort} to indTypeInstCache`
                                                                              • define smt sort (define-sort Prop () Bool)
                                                                              • declare smt function (declare-fun @isProp ((Prop)) Bool) with true assertion
                                                                            • When isType t

                                                                              • add entry t := {@isType, typeSort} to indTypeInstCache`
                                                                              • Define smt univseral sort @@Type when flag typeUniverse is not set (see function declareTypeSort`)

                                                                            An error is triggered when t is not the expected sort type.

                                                                            Equations
                                                                            Instances For

                                                                              TODO: UPDATE SPEC

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

                                                                                Options for translateType.

                                                                                • inTypeDefinition : Bool

                                                                                  flag set to true only when translating an inductive datatype so as not to generate predicate qualifier for generic types used in ctor parameters.

                                                                                • genericParamFun : Bool

                                                                                  flag set to true only when translating type of function arguments so as to use universal sort @@Type when function are still polymorphic after instantiation.

                                                                                Instances For

                                                                                  type options to be used when translating inductive datatype.

                                                                                  Equations
                                                                                  Instances For

                                                                                    type options to be used when generating predicate qualifiers.

                                                                                    Equations
                                                                                    Instances For

                                                                                      Same as optionsForPredicateQualifier.

                                                                                      Equations
                                                                                      Instances For

                                                                                        TODO: UPDATE SPEC

                                                                                        Given indValStart an inductive value info for an inductive datatype, update the inductive datatype declaration indTypeMap. Intuitively, for the non-mutual inductive List, inductive List (α : Type u) where | nil : List α | cons (head : α) (tail : List α) : List α

                                                                                        The following entry will be added. `List := [{ indName := List, numParams := 1, hasProp := false ctors := [ { ctorName := nil, nbFields := 0, hasProp := false, propIndices := [], rhs := λ α : Type u → nil }, { ctorName := cons, nbFields := 2, hasProp := false, propIndices := [], rhs := λ α : Type u → λ head : α → λ tail : List α → cons head tail } ]

                                                                                        As for the following mutual inductive declaration, mutual inductive Attribute (α : Type u) where | Named (n : String) | Pattern (p : List (Term α)) | Qid (n : String)

                                                                                        inductive Term (α : Type u) where
                                                                                        | Ident (s : String)
                                                                                        | App (nm : String) (args : List (Term α))
                                                                                        | Annotated (t : Term α) (annot : List (Attribute α))
                                                                                        

                                                                                        end

                                                                                        The following entries will be added:

                                                                                        • Attribute := decls
                                                                                        • Term := decls with decls := [{ indName := Attribute, numParams := 1, hasProp := false, ctors := [ { ctorName := Named, nbFields := 1, hasProp := false, propIndices := [], rhs := λ α : Type u → λ n : String → Named n }, { ctorName := Pattern, nbFields := 1, hasProp := false, propIndices := [], rhs := λ α : Type u → λ p : List (Term α) → Pattern p } { ctorName := Qid, nbFields := 1, hasProp := false, propIndices := [], rhs := λ α : Type u → λ n : String → Qid n } ] }, { indName := Term, numParams := 1, hasProp := false, ctors := [ { ctorName := Named, nbFields := 1, hasProp := false, propIndices := [], rhs := λ α : Type u → λ s : String → Ident s }, { ctorName := App, nbFields := 2, hasProp := false, propIndices := [], rhs := λ α : Type u → λ nm : String → λ args : List (Term α) → App nm args }, { ctorName := Annotated, nbFields := 2, hasProp := false, propIndices := [], rhs := λ α : Type u → λ t : Term α → λ annot : List (Attribute α) → Annotated nm args } ] } ]

                                                                                        Note that optimizer is called on each constructor rhs to apply proper formalization when at least one of the arguments is a proposition.

                                                                                        An error is triggered when:

                                                                                        • ∀ n ∈ indValStart.all
                                                                                          • no inductive info is found for n;
                                                                                          • no recursive info is found for n;
                                                                                          • no recursor rule is found for at least one constructor for n.
                                                                                        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 an instantiated inductive data type t x₁ ... xₙ, generate it's corresponding predicate qualifier predicate and propositional assertions when instance is not already in indTypeInstCache. In particular,

                                                                                                  • let instApp ← getIndInst t #[x₁, ..., xₙ]
                                                                                                  • When instApp := {instName, instSort} ∈ indTypeInstCache
                                                                                                    • return ()
                                                                                                  • Otherwise:
                                                                                                    • let {instName, instSort} ← generateIndInstDecl t args typeTranslator
                                                                                                    • When `∀ c ∈ Ctors(t), c = C (i.e., nullary constructors)
                                                                                                      • declare smt predicate (declare-fun @is{instName} ((instSort)) Bool)`
                                                                                                    • Otherwise:
                                                                                                      • declare smt predicate (declare-fun @is{instName} ((instSort)) Bool)`
                                                                                                      • For each c ∈ Ctors(t),
                                                                                                        • When c = C (i.e., nullary constructor) don't generate any assertion
                                                                                                        • When c = C p₁ ... pₙ, generate assertion (assert (forall ((@x instSort)) (! (=> (@is{instName} @x) (=> is-C @x (and predTermᵢ ... predTermₙ))) :pattern ((@is{instName} @x) (is-C @x))))) with ∀ i ∈ [1..n], (isProp pᵢ → predTermᵢ = (= (C.i @x) (← termTranslator (← optimizeExpr pᵢ)))) ∧ (¬ isProp pᵢ → predTermᵢ = (isTypeᵢ (C.i @x))) TODO: UPDATE SPEC
                                                                                                  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

                                                                                                      TODO: UPDATE SPEC.

                                                                                                      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 name expression for which a corresponding smt sort exists (e.g., Bool, Int, String), s its corresponding Smt symbol and t its corresponding Smt sort, perform the following actions:

                                                                                                          • When entry n := s exists in indTypeInstCache
                                                                                                            • return t
                                                                                                          • Otherwise:
                                                                                                            • add entry n := s in indTypeInstCache
                                                                                                            • define smt predicate (define-fun @is{s} ((@x s)) Bool true)
                                                                                                            • return t
                                                                                                          Equations
                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                          Instances For

                                                                                                            Perform the following actions:

                                                                                                            • When entry n := "Nat" exists in indTypeInstCache return #[natSort]
                                                                                                            • Otherwise:
                                                                                                              • add entry n := {@isNat, natSort} in indTypeInstCache
                                                                                                              • define smt sort (define-sort Nat () Int)
                                                                                                              • define smt predicate (define-fun @isNat ((@x Nat)) Bool (<= 0 @x))
                                                                                                              • return natSort Assume that n := Expr.const ``Nat [].
                                                                                                            Equations
                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                            Instances For

                                                                                                              Perform the following actions:

                                                                                                              • When entry n := "Empty" exists in indTypeInstCache
                                                                                                                • return emptySort
                                                                                                              • Otherwise:
                                                                                                                • add entry n := "Empty" in indTypeInstCache
                                                                                                                • add entry n := {@isEmpty, emptySort} in indTypeInstCache`
                                                                                                                • declare smt sort (declare-sort Empty 0)
                                                                                                                • define smt predicate (define-fun @isEmpty (@x (Empty)) Bool false)
                                                                                                                • return emptySort Assume that n := Expr.const ``Empty [].
                                                                                                              Equations
                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                              Instances For

                                                                                                                Perform the following actions:

                                                                                                                • When entry n := "PEmpty" exists in indTypeInstCache
                                                                                                                  • return pemptySort
                                                                                                                • Otherwise:
                                                                                                                  • add entry n := {@isPEmpty, pemptySort} in indTypeInstCache
                                                                                                                  • declare smt sort (declare-sort PEmpty 0)
                                                                                                                  • define smt predicate (define-fun @isPEmpty ((PEmpty)) Bool false)
                                                                                                                  • return pemptySort Assume that n := Expr.const ``PEmpty [..].
                                                                                                                Equations
                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                Instances For

                                                                                                                  Translate opaque sorts to their Smt counterpart. An error is triggered when e does not correspond to a name expression. TODO: update function when opacifying other Lean inductive types (e.g., BitVector, Char, etc).

                                                                                                                  Equations
                                                                                                                  Instances For

                                                                                                                    TODO: UPDATE SPEC

                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      Instances For
                                                                                                                        Equations
                                                                                                                        Instances For

                                                                                                                          Translate a quantifier (n : t) by performing the following actions:

                                                                                                                          • Add n to the quantified fvars cache.
                                                                                                                          • When isType t, e.g., (α : Type or α : Sort u)
                                                                                                                            • Call defineSortAndCache n to declare an Smt sort and return quantified array qts unchanged
                                                                                                                          • When ¬ isType t:
                                                                                                                            • translate n to an Smt symbol s
                                                                                                                            • translate t to a Smt type st
                                                                                                                            • When toplevel flag is set:
                                                                                                                              • Call declareConst s st to declare a free Smt scalar variable when st := α (i.e., scalar type).
                                                                                                                              • Call declareFun s #[α₁ ... αₙ] β to declare an uninterpreted Smt function when st := α₁ → ... → αₙ → β.
                                                                                                                            • When toplevel flag is not set:
                                                                                                                              • Add (s : st) to quantifier array qts when st := α (i.e., scalar type)
                                                                                                                              • Add (s : Array α₁ ... αₙ β) to quantifier array qts when st := α₁ → ... → αₙ → β.

                                                                                                                          Assume that t is not a proposition (i.e., !(← isPropEnv t)) nor a class constraint. An error is triggered if n is not an fvar expression.

                                                                                                                          TODO: UPDATE SPEC

                                                                                                                          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

                                                                                                                                TODO: UPDATE SPEC

                                                                                                                                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

                                                                                                                                    Translate free variable expression f := Expr.fvar v to an Smt term such that:

                                                                                                                                    • When v ∈ (← get).smtEnv.quantifiedFVars:
                                                                                                                                      • return `fvarIdToSmtTerm v
                                                                                                                                    • When v ∉ (← get).smtEnv.quantifiedFVars:
                                                                                                                                      • add v to the quantified fvars cache
                                                                                                                                      • Let t' ← removeTypeAbbrev (← inferTypeEnv f)
                                                                                                                                      • smtType ← translateType optimize termTranslator t'
                                                                                                                                      • smtSym ← fvarIdToSmtSymbol v
                                                                                                                                      • declare smt symbol at top level, i.e., (declare-const smtSym smtType)
                                                                                                                                      • pTerm ← createPredQualifierApp smtSym t'
                                                                                                                                      • assert pTerm at smt level, i.e., (assert pTerm)
                                                                                                                                      • return smtSimpleVarId smtSym An error is triggered when
                                                                                                                                      • f is not an fvar expression; or
                                                                                                                                      • f has a sort type
                                                                                                                                    Equations
                                                                                                                                    Instances For