Equations
- Auto.instBEqMonoMode = { beq := Auto.beqMonoMode✝ }
Equations
- Auto.instHashableMonoMode = { hash := Auto.hashMonoMode✝ }
Equations
- Auto.instInhabitedMonoMode = { default := Auto.MonoMode.fol }
Equations
- Auto.instToStringMonoMode = { toString := fun (x : Auto.MonoMode) => match x with | Auto.MonoMode.fol => "fol" | Auto.MonoMode.hol => "hol" }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Auto.Monomorphization.getRecordInstInst = do let __do_lift ← Lean.getOptions pure (Lean.Option.get __do_lift auto.mono.recordInstInst)
Instances For
Equations
- Auto.Monomorphization.getMode = do let __do_lift ← Lean.getOptions pure (Lean.Option.get __do_lift auto.mono.mode)
Instances For
Equations
- Auto.Monomorphization.getIgnoreNonQuasiHigherOrder = do let __do_lift ← Lean.getOptions pure (Lean.Option.get __do_lift auto.mono.ignoreNonQuasiHigherOrder)
Instances For
- fvar : Lean.FVarId → CiHead
- mvar : Lean.MVarId → CiHead
- const : Lean.Name → Array Lean.Level → CiHead
Instances For
Equations
Equations
Equations
- Auto.Monomorphization.CiHead.ofExpr? (Lean.Expr.fvar id) = some (Auto.Monomorphization.CiHead.fvar id)
- Auto.Monomorphization.CiHead.ofExpr? (Lean.Expr.mvar id) = some (Auto.Monomorphization.CiHead.mvar id)
- Auto.Monomorphization.CiHead.ofExpr? (Lean.Expr.const name lvls) = some (Auto.Monomorphization.CiHead.const name { toList := lvls })
- Auto.Monomorphization.CiHead.ofExpr? x✝ = none
Instances For
Equations
Instances For
Ignore constant's levels
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- ci.inferType = Lean.Meta.inferType ci.toExpr
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Remark: This function assigns level mvars if necessary
Equations
- One or more equations did not get rendered due to their size.
- (Auto.Monomorphization.CiHead.fvar a).equiv (Auto.Monomorphization.CiHead.fvar b) = pure (a == b)
- (Auto.Monomorphization.CiHead.mvar a).equiv (Auto.Monomorphization.CiHead.mvar b) = pure (a == b)
- ch₁.equiv ch₂ = pure false
Instances For
If a constant c
is of type ∀ (xs : αs), t
,
then its valid instance will be c
with all of its
universe levels, dependent arguments and instance
arguments instantiated. So, we record the instantiation
of universe levels and dependent arguments.
As to monomorphization, we will not record instances of
constants with instance
attribute or whose type is
a class.
- head : CiHead
Instances For
Equations
- ci.fingerPrint = ci.head.fingerPrint
Instances For
Equations
- One or more equations did not get rendered due to their size.
Remark: This function assigns metavariables if necessary,
but its only usage in this file is under Meta.withNewMCtxDepth
Note that since ci₁, ci₂
are both ConstInst
, they does not
contain loose bound variables
Equations
- One or more equations did not get rendered due to their size.
Instances For
Remark:
· This function assigns metavariables if necessary
· Runs in MetaM
, so e
should not have loose bound variables
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given an hypothesis t
, we will traverse the hypothesis and
call ConstInst.ofExpr?
to find instances of polymorphic constants
· Binders of the hypothesis are introduced as fvars, these fvars are
recorded in bvars
· param
records universe level parameters of the hypothesis
So, the criterion that an expression e
is a valid instance is that
· All dependent arguments and instance arguments are present
· The head does not contain expressions in bvars
· Dependent arguments does not contains expressions in bvars
· The expression does not contain level parameters in params
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
Precondition : .some ci == ← ConstInst.ofExpr? e
Returns the list of non-dependent arguments in e.getAppArgs
Equations
- One or more equations did not get rendered due to their size.
Instances For
Array of instances of a polymorphic constant
Instances For
Given an array cis
and a potentially new instance ci
· If ci
is new, add it to ConstInsts
and return true
· If ci
is not new, return an element of the original ConstInsts
which is definitionally equal to ci
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a LemmaInst li
and a ConstInst ci
, try to match all subexpressions of li
against ci
Equations
- One or more equations did not get rendered due to their size.
Instances For
Check whether the leading ∀
quantifiers of expression e
violates the quasi-monomorphic condition
Equations
Instances For
Test whether a lemma is type monomorphic && universe monomorphic
By universe monomorphic we mean lem.params = #[]
If all dependent arguments are instantiated, but some instance
arguments are not instantiated, we will try to synthesize the instance arguments
Equations
- One or more equations did not get rendered due to their size.
Instances For
Monomorphization works as follows:
(1) Turning Lemma
s into LemmaInst
s, which constitutes the
value of lisArr
in the beginning
(2) Scan through all assumptions to find subterms that are
valid instances of constants (dependent arguments fully
instantiated). They form the initial elements of ciMap
and activeCi
(3) Repeat:
· Dequeue an element active
· If it is a ConstInst
, match against all existing LemmaInst
;
If it is a LemmaInst
, match against all existing ConstInst
· For all the new LemmaInst
s generated and all the ConstInst
s
occurring in them to active
- ciMap : Std.HashMap Lean.Expr ConstInsts
- lisArr : Array LemmaInsts
Instances For
Equations
Instances For
Equations
- Auto.Monomorphization.getLisArr = do let st ← get pure st.lisArr
Instances For
Equations
- Auto.Monomorphization.setActive field = modify fun (st : Auto.Monomorphization.State) => { ciMap := st.ciMap, lisArr := st.lisArr, ciInstDefEqs := st.ciInstDefEqs, active := field }
Instances For
Equations
- Auto.Monomorphization.getCiMap = do let st ← get pure st.ciMap
Instances For
Equations
- Auto.Monomorphization.getCiInstDefEqs = do let st ← get pure st.ciInstDefEqs
Instances For
Equations
- Auto.Monomorphization.setCiMap field = modify fun (st : Auto.Monomorphization.State) => { ciMap := field, lisArr := st.lisArr, ciInstDefEqs := st.ciInstDefEqs, active := st.active }
Instances For
Equations
- Auto.Monomorphization.setLisArr field = modify fun (st : Auto.Monomorphization.State) => { ciMap := st.ciMap, lisArr := field, ciInstDefEqs := st.ciInstDefEqs, active := st.active }
Instances For
Equations
- Auto.Monomorphization.setCiInstDefEqs field = modify fun (st : Auto.Monomorphization.State) => { ciMap := st.ciMap, lisArr := st.lisArr, ciInstDefEqs := field, active := st.active }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Process a potentially new ConstInst. If it's new, return its index
in the corresponding ConstInsts
array. If it's not new, return .none
.
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
Monomorphization works as follows:
(1) Turning Lemma
s into LemmaInst
s, which constitutes the
value of lisArr
in the beginning
(2) Scan through all assumptions to find subterms that are
valid instances of constants (dependent arguments fully
instantiated). They form the initial elements of ciMap
and activeCi
(3) Repeat:
· Dequeue an element active
· If it is a ConstInst
, match against all existing LemmaInst
;
If it is a LemmaInst
, match against all existing ConstInst
· For all the new LemmaInst
s generated and all the ConstInst
s
occurring in them to active
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
- Auto.Monomorphization.saturate.isTrigger (Auto.Monomorphization.CiHead.const name a) = (name == `Auto.SMT.Attribute.trigger)
- Auto.Monomorphization.saturate.isTrigger cih = false
Instances For
Remove non-monomorphic lemma instances
Equations
- One or more equations did not get rendered due to their size.
Instances For
Collect inductive types
Equations
- One or more equations did not get rendered due to their size.
Instances For
- bfvars : Array Lean.FVarId
- ffvars : Array Lean.FVarId
- exprMap : Std.HashMap Lean.Expr Lean.FVarId
- ciMap : Std.HashMap Lean.Expr ConstInsts
- ciIdMap : Std.HashMap ConstInst Lean.FVarId
- idCiMap : Std.HashMap Lean.FVarId ConstInst
- tyCanMap : Std.HashMap Lean.Expr Lean.Expr
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Auto.Monomorphization.FVarRep.getFfvars = do let st ← get pure st.ffvars
Instances For
Equations
- Auto.Monomorphization.FVarRep.getExprMap = do let st ← get pure st.exprMap
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
- Auto.Monomorphization.FVarRep.getIdCiMap = do let st ← get pure st.idCiMap
Instances For
Equations
- Auto.Monomorphization.FVarRep.getCiMap = do let st ← get pure st.ciMap
Instances For
Equations
- Auto.Monomorphization.FVarRep.getBfvars = do let st ← get pure st.bfvars
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Auto.Monomorphization.FVarRep.getCiIdMap = do let st ← get pure st.ciIdMap
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Auto.Monomorphization.FVarRep.getTyCanMap = do let st ← get pure st.tyCanMap
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Similar to Monomorphization.processConstInst
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.
- Auto.Monomorphization.FVarRep.processType.processTypeAux x✝ = Auto.Monomorphization.FVarRep.processType.addTypeToTyCanMap x✝
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
Attempt to abstract parts of a given expression to free variables so that the resulting expression is in the higher-order fragment of Lean.
Note that it's not always possible to do this since it's possible that the given expression itself is polymorphic
Since we're now dealing with monomorphized lemmas, there are no bound level parameters
Return value:
· If abstraction is successful, return the abstracted expression
· If abstraction is not successful because the input is not a quasi higher-order
term of type Prop
, return a message indicating the violation of quasi higher-order-ness
· Throw an error message if unexpected error happens
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given mvarId : ty
, create a fresh mvar m
of type
monofact₁ → monofact₂ → ⋯ → monofactₙ → ty
and return (m proof₁ proof₂ ⋯ proofₙ, m)
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
Instantiating quantifiers, collecting inductive types and filtering out non-quasi-monomorphic expressions
Equations
- One or more equations did not get rendered due to their size.
Instances For
Process lemmas and inductive types, collect inhabited types
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.