We use this auxiliary constant to mark delayed congruence proofs.
Equations
- Lean.Meta.Grind.congrPlaceholderProof = Lean.mkConst (Lean.Name.mkSimple "[congruence]")
Instances For
Similar to isDefEq, but ensures default transparency is used.
Equations
Instances For
Similar to isDefEq, but ensures that only reducible definitions and instances can be reduced.
Equations
Instances For
Returns true if e is True, False, or a literal value.
See Lean.Meta.LitValues for supported literals.
Equations
Instances For
Opaque solver extension state.
Case-split source. That is, where it came from.
We store the current source in the grind context.
- ematch
(origin : Origin)
 : SplitSourceGenerated while instantiating a theorem using E-matching. 
- ext
(declName : Name)
 : SplitSourceGenerated while instantiating an extensionality theorem with name declName
- mbtc
(a b : Expr)
(i : Nat)
 : SplitSourceModel-based theory combination equality coming from the i-th argument of applications aandb
- beta
(e : Expr)
 : SplitSourceBeta-reduction. 
- forallProp
(e : Expr)
 : SplitSourceForall-propagator. 
- existsProp
(e : Expr)
 : SplitSourceExists-propagator. 
- input : SplitSourceInput goal 
- inj
(origin : Origin)
 : SplitSourceInjectivity theorem. 
Instances For
Equations
- One or more equations did not get rendered due to their size.
- (Lean.Meta.Grind.SplitSource.ematch origin).toMessageData = Lean.toMessageData "E-matching " ++ Lean.toMessageData origin.pp
- (Lean.Meta.Grind.SplitSource.ext declName).toMessageData = Lean.toMessageData "Extensionality " ++ Lean.toMessageData declName
- (Lean.Meta.Grind.SplitSource.beta e).toMessageData = Lean.toMessageData "Beta-reduction of" ++ Lean.toMessageData (Lean.indentExpr e)
- (Lean.Meta.Grind.SplitSource.forallProp e).toMessageData = Lean.toMessageData "Forall propagation at" ++ Lean.toMessageData (Lean.indentExpr e)
- (Lean.Meta.Grind.SplitSource.existsProp e).toMessageData = Lean.toMessageData "Exists propagation at" ++ Lean.toMessageData (Lean.indentExpr e)
- Lean.Meta.Grind.SplitSource.input.toMessageData = (Lean.MessageData.ofFormat ∘ Std.format) "Initial goal"
- (Lean.Meta.Grind.SplitSource.inj origin).toMessageData = Lean.toMessageData "Injectivity " ++ Lean.toMessageData origin.pp
Instances For
Context for GrindM monad.
- simp : Simp.Context
- simpMethods : Simp.Methods
- config : Grind.Config
- cheapCases : BoolIf cheapCasesistrue,grindonly appliescasesto types that contain at most one minor premise. Recall thatgrindappliescaseswhen introducing types tagged with[grind cases eager], and atSplit.leanRemark: We add this option to implement thelookaheadfeature, we don't want to create several subgoals when performing lookahead.
- reportMVarIssue : Bool
- splitSource : SplitSourceCurrent source of case-splits. 
- symPrios : SymbolPrioritiesSymbol priorities for inferring E-matching patterns 
- trueExpr : Expr
- falseExpr : Expr
- natZExpr : Expr
- btrueExpr : Expr
- bfalseExpr : Expr
- ordEqExpr : Expr
- intExpr : Expr
Instances For
Key for the congruence theorem cache.
Instances For
Equations
- Lean.Meta.Grind.instBEqCongrTheoremCacheKey = { beq := fun (a b : Lean.Meta.Grind.CongrTheoremCacheKey) => Lean.Meta.Grind.isSameExpr a.f b.f && a.numArgs == b.numArgs }
Equations
- Lean.Meta.Grind.instHashableCongrTheoremCacheKey = { hash := fun (a : Lean.Meta.Grind.CongrTheoremCacheKey) => mixHash (Lean.Meta.Grind.hashPtrExpr a.f) (hash a.numArgs) }
- origin : Origin
- kind : EMatchTheoremKind
- minIndexable : Bool
Instances For
Equations
Instances For
Equations
Instances For
E-match theorems and case-splits performed by grind.
Note that it may contain elements that are not needed by the final proof.
For example, grind instantiated the theorem, but theorem instance was not actually used
in the proof.
- thms : PHashSet EMatchTheoremTrace
Instances For
Equations
Instances For
Equations
- Number of times E-match theorem has been instantiated. 
- Number of times a - caseshas been performed on an inductive type/predicate
- Number of applications per function symbol. This information is only collected if - set_option diagnostics true
Instances For
Equations
Instances For
Case-split diagnostic information
- lctx : LocalContext
- c : Expr
- gen : Nat
- numCases : Nat
- splitSource : SplitSource
Instances For
State for the GrindM monad.
- scState : AlphaShareCommon.StateShareCommon(akaHash-consing) state.
- congrThms : PHashMap CongrTheoremCacheKey CongrTheoremCongruence theorems generated so far. Recall that for constant symbols we rely on the reserved name feature (i.e., mkHCongrWithArityForConst?). Remark: we currently do not reuse congruence theorems
- simp : Simp.State
- lastTag : NameUsed to generate trace messages of the for [grind] working on <tag>, and implement the macrotrace_goal.
- issues : List MessageDataIssues found during the proof search. These issues are reported to users when grindfails.
- trace : Tracetraceforgrind?
- counters : CountersPerformance counters 
- splitDiags : PArray SplitDiagInfoSplit diagnostic information. This information is only collected when set_option diagnostics true
- Cached anchors (aka stable hash codes) for terms in the - grindstate.
Instances For
Instances For
Equations
Instances For
Equations
- Lean.Meta.Grind.mapGrindM f x = controlAt Lean.Meta.Grind.GrindM fun (runInBase : {β : Type} → m β → Lean.Meta.Grind.GrindM (stM Lean.Meta.Grind.GrindM m β)) => f (runInBase x)
Instances For
Equations
- Lean.Meta.Grind.saveState = do let __do_lift ← liftM Lean.Meta.saveState let __do_lift_1 ← get pure { «meta» := __do_lift, grind := __do_lift_1 }
Instances For
Equations
- Lean.Meta.Grind.instMonadBacktrackSavedStateGrindM = { saveState := Lean.Meta.Grind.saveState, restoreState := fun (s : Lean.Meta.Grind.SavedState) => s.restore }
withoutReportingMVarIssues x executes x without reporting metavariables found during internalization.
See comment at Grind.Context.reportMVarIssue for additional details.
Equations
- One or more equations did not get rendered due to their size.
Instances For
withSplitSource s x executes x and uses s as the split source for any case-split
registered.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the user-defined configuration options
Equations
- Lean.Meta.Grind.getConfig = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.config
Instances For
Returns the internalized True constant.
Equations
- Lean.Meta.Grind.getTrueExpr = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.trueExpr
Instances For
Returns the internalized False constant.
Equations
- Lean.Meta.Grind.getFalseExpr = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.falseExpr
Instances For
Returns the internalized Bool.true.
Equations
- Lean.Meta.Grind.getBoolTrueExpr = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.btrueExpr
Instances For
Returns the internalized Bool.false.
Equations
- Lean.Meta.Grind.getBoolFalseExpr = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.bfalseExpr
Instances For
Returns the internalized 0 : Nat numeral.
Equations
- Lean.Meta.Grind.getNatZeroExpr = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.natZExpr
Instances For
Returns the internalized Ordering.eq.
Equations
- Lean.Meta.Grind.getOrderingEqExpr = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.ordEqExpr
Instances For
Returns the internalized Int.
Equations
- Lean.Meta.Grind.getIntExpr = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.intExpr
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.Grind.cheapCasesOnly = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.cheapCases
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.Grind.reportMVarInternalization = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.reportMVarIssue
Instances For
Returns symbol priorities for inferring E-matching patterns.
Equations
- Lean.Meta.Grind.getSymbolPriorities = do let __do_lift ← readThe Lean.Meta.Grind.Context pure __do_lift.symPrios
Instances For
Returns true if declName is the name of a match equation or a match congruence equation.
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.
- Lean.Meta.Grind.saveAppOf h = do let __do_lift ← liftM Lean.isDiagnosticsEnabled if __do_lift = true then pure () else pure PUnit.unit
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Returns maximum term generation that is considered during ematching.
Equations
- Lean.Meta.Grind.getMaxGeneration = do let __do_lift ← Lean.Meta.Grind.getConfig pure __do_lift.gen
Instances For
Abstracts nested proofs in e. This is a preprocessing step performed before internalization.
Equations
Instances For
Returns true if e is the internalized True expression.
Equations
- Lean.Meta.Grind.isTrueExpr e = do let __do_lift ← Lean.Meta.Grind.getTrueExpr pure (Lean.Meta.Grind.isSameExpr e __do_lift)
Instances For
Returns true if e is the internalized False expression.
Equations
- Lean.Meta.Grind.isFalseExpr e = do let __do_lift ← Lean.Meta.Grind.getFalseExpr pure (Lean.Meta.Grind.isSameExpr e __do_lift)
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
Similar to expandReportIssueMacro, but only reports issue if grind.debug is set to true
Equations
- One or more equations did not get rendered due to their size.
Instances For
Similar to reportIssue!, but only reports issue if grind.debug is set to true
Equations
- One or more equations did not get rendered due to their size.
Instances For
Each E-node may have "solver terms" attached to them.
Each term is an element of the equivalence class that the
solver cares about. Each solver is responsible for marking the terms they care about.
The grind core propagates equalities and disequalities to the theory solvers
using these "marked" terms. The root of the equivalence class
contains a list of representatives sorted by solver id. Note that many E-nodes
do not have any solver terms attached to them.
"Solver terms" are referenced as "theory variables" in the SMT literature. The SMT solver Z3 uses a similar representation.
- nil : SolverTerms
- next (solverId : Nat) (e : Expr) (rest : SolverTerms) : SolverTerms
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Stores information for a node in the E-graph.
Each internalized expression e has an ENode associated with it.
- self : ExprNode represented by this ENode. 
- next : ExprNext element in the equivalence class. 
- root : ExprRoot (aka canonical representative) of the equivalence class 
- congr : Expr
- flipped : BoolProof has been flipped. 
- size : NatNumber of elements in the equivalence class, this field is meaningless if node is not the root. 
- interpreted : Boolinterpreted := trueif node should be viewed as an abstract value.
- ctor : Boolctor := trueif the head symbol is a constructor application.
- hasLambdas : BoolhasLambdas := trueif the equivalence class contains lambda expressions.
- heqProofs : BoolIf heqProofs := true, then some proofs in the equivalence class are based on heterogeneous equality.
- idx : NatUnique index used for pretty printing and debugging purposes. 
- generation : NatThe generation in which this enode was created. 
- mt : NatModification time 
- sTerms : SolverTermsSolver terms attached to this E-node. 
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
- (Lean.Meta.Grind.NewFact.eq lhs rhs proof isHEq).toExpr = Lean.Meta.mkEq lhs rhs
- (Lean.Meta.Grind.NewFact.fact p proof generation).toExpr = pure p
Instances For
Instances For
Key for the congruence table.
We need access to the enodes to be able to retrieve the equivalence class roots.
- e : Expr
Instances For
Equations
- Lean.Meta.Grind.instHashableCongrKey = { hash := fun (k : Lean.Meta.Grind.CongrKey enodeMap) => Lean.Meta.Grind.instHashableCongrKey._private_1 k }
Equations
- Lean.Meta.Grind.instBEqCongrKey = { beq := fun (k1 k2 : Lean.Meta.Grind.CongrKey enodeMap) => Lean.Meta.Grind.instBEqCongrKey._private_1 k1 k2 }
Equations
- Lean.Meta.Grind.CongrTable enodeMap = Lean.PHashSet (Lean.Meta.Grind.CongrKey enodeMap)
Instances For
Instances For
Equations
Instances For
The E-matching module instantiates theorems using the EMatchTheorem proof and a (partial) assignment.
We want to avoid instantiating the same theorem with the same assignment more than once.
Therefore, we store the (pre-)instance information in set.
Recall that the proofs of activated theorems have been hash-consed.
The assignment contains internalized expressions, which have also been hash-consed.
- proof : Expr
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Instances For
New raw fact to be preprocessed, and then asserted.
- proof : Expr
- prop : Expr
- generation : Nat
- splitSource : SplitSourcesplitSourceto use when internalizing this fact.
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
E-matching related fields for the grind goal.
- thmMap : EMatchTheoremsInactive global theorems. As we internalize terms, we activate theorems as we find their symbols. Local theorem provided by users are added directly into newThms.
- gmt : NatGoal modification time. 
- thms : PArray EMatchTheoremActive theorems that we have performed ematching at least once. 
- newThms : PArray EMatchTheoremActive theorems that we have not performed any round of ematching yet. 
- numInstances : NatNumber of theorem instances generated so far 
- num : NatNumber of E-matching rounds performed in this goal since the last case-split. 
- preInstances : PreInstanceSet(pre-)instances found so far. It includes instances that failed to be instantiated. 
- nextThmIdx : NatNext local E-match theorem idx. 
- matchauxiliary functions whose equations have already been created and activated.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Case-split information.
- default
(e : Expr)
(source : SplitSource)
 : SplitInfoTerm emay be an inductive predicate,match-expression,if-expression, implication, etc.
- imp
(e : Expr)
(h : e.isForall = true)
(source : SplitSource)
 : SplitInfoeis an implication and we want to split on its antecedent.
- arg
(a b : Expr)
(i : Nat)
(eq : Expr)
(source : SplitSource)
 : SplitInfoGiven applications aandb, case-split on whether the correspondingi-th arguments are equal or not. The split is only performed if all other arguments are already known to be equal or are also tagged as split candidates.
Instances For
Equations
- (Lean.Meta.Grind.SplitInfo.default e source).hash = hash e
- (Lean.Meta.Grind.SplitInfo.imp e h source).hash = hash e
- (Lean.Meta.Grind.SplitInfo.arg a b i e source).hash = hash e
Instances For
Equations
Equations
- (Lean.Meta.Grind.SplitInfo.default e₁ source).beq (Lean.Meta.Grind.SplitInfo.default e₂ source_1) = (e₁ == e₂)
- (Lean.Meta.Grind.SplitInfo.imp e₁ h source).beq (Lean.Meta.Grind.SplitInfo.imp e₂ h_1 source_1) = (e₁ == e₂)
- (Lean.Meta.Grind.SplitInfo.arg a₁ b₁ i₁ eq₁ source).beq (Lean.Meta.Grind.SplitInfo.arg a₂ b₂ i₂ eq₂ source_1) = (a₁ == a₂ && b₁ == b₂ && i₁ == i₂ && eq₁ == eq₂)
- x✝¹.beq x✝ = false
Instances For
Equations
Equations
- (Lean.Meta.Grind.SplitInfo.default e source).getExpr = e
- (Lean.Meta.Grind.SplitInfo.imp e h source).getExpr = e.forallDomain h
- (Lean.Meta.Grind.SplitInfo.arg a b i e source).getExpr = e
Instances For
Equations
- (Lean.Meta.Grind.SplitInfo.default e source).source = source
- (Lean.Meta.Grind.SplitInfo.imp e h source).source = source
- (Lean.Meta.Grind.SplitInfo.arg a b i e source).source = source
Instances For
Equations
- (Lean.Meta.Grind.SplitInfo.default e₁ source).lt (Lean.Meta.Grind.SplitInfo.default e₂ source_1) = e₁.lt e₂
- (Lean.Meta.Grind.SplitInfo.imp e₁ h source).lt (Lean.Meta.Grind.SplitInfo.imp e₂ h_1 source_1) = e₁.lt e₂
- (Lean.Meta.Grind.SplitInfo.arg a b i e₁ source).lt (Lean.Meta.Grind.SplitInfo.arg a_1 b_1 i_1 e₂ source_1) = e₁.lt e₂
- (Lean.Meta.Grind.SplitInfo.default e source).lt x✝ = true
- (Lean.Meta.Grind.SplitInfo.imp e h source).lt x✝ = true
- x✝¹.lt x✝ = false
Instances For
Case splitting related fields for the grind goal.
- num : NatNumber of splits performed to get to this goal. 
- casesTypes : CasesTypesInductive datatypes marked for case-splitting 
- Case-split candidates. 
- added : Std.HashSet SplitInfoCase-splits that have been inserted at candidatesat some point.
- Case-splits that have already been performed, or that do not have to be performed anymore. 
- Sequence of cases steps that generated this goal. We only use this information for diagnostics. Remark: - casesTrace.length ≥ numSplitsbecause we don't increase the counter for- casesapplications that generated only 1 subgoal.
- Lookahead "case-splits". 
- A mapping - (a, b) ↦ iss.t. for each- SplitInfo.arg a b i eqin- candidatesor- lookaheadswe have- i ∈ is. We use this information to decide whether the split/lookahead is "ready" to be tried or not.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Equations
Instances For
Instances For
State for injective theorem support.
- thms : InjectiveTheorems
- fns : PHashMap ExprPtr InjectiveInfo
Instances For
Instances For
The grind goal.
- mvarId : MVarId
- canon : Canon.State
- enodeMap : ENodeMap
- parents : ParentMap
- congrTable : CongrTable self.enodeMap
- A mapping from each function application index ( - HeadIndex) to a list of applications with that index. Recall that the- HeadIndexfor a constant is its constant name, and for a free variable, it is its unique id.
- Equations and propositions to be processed. 
- inconsistent : Boolinconsistent := trueifENodes forTrueandFalseare in the same equivalence class.
- nextIdx : NatNext unique index for creating ENodes 
- newRawFacts : Std.Queue NewRawFactnew facts to be preprocessed and then asserted. 
- Asserted facts 
- extThms : PHashMap ExprPtr (Array Ext.ExtTheorem)Cached extensionality theorems for types. 
- ematch : EMatch.StateState of the E-matching module. 
- inj : Injective.StateState of the injective function procedure. 
- split : Split.StateState of the case-splitting module. 
- clean : Clean.StateState of the clean name generator. 
- sstates : Array SolverExtensionStateSolver states. 
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- g.hasSameRoot a b = Lean.Meta.Grind.hasSameRoot✝ g.enodeMap a b
Instances For
Equations
- g.isCongruent a b = Lean.Meta.Grind.isCongruent✝ g.enodeMap a b
Instances For
Equations
Instances For
Equations
- Lean.Meta.Grind.GoalM.run goal x = goal.mvarId.withContext (Lean.Meta.Grind.GoalM.runCore goal x)
Instances For
Equations
- Lean.Meta.Grind.GoalM.run' goal x = goal.mvarId.withContext ((x *> get).run' goal)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Macro similar to trace[...], but it includes the trace message trace[grind] "working on <current goal>"
if the tag has changed since the last trace message.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A helper function used to mark a theorem instance found by the E-matching module.
It returns true if it is a new instance and false otherwise.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds a new fact prop with proof proof to the queue for preprocessing and the assertion.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the number of theorem instances generated so far.
Equations
- Lean.Meta.Grind.getNumTheoremInstances = do let __do_lift ← get pure __do_lift.ematch.numInstances
Instances For
Adds a new theorem instance produced using E-matching.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns true if the maximum number of instances has been reached.
Equations
- Lean.Meta.Grind.checkMaxInstancesExceeded = do let __do_lift ← get let __do_lift_1 ← liftM Lean.Meta.Grind.getConfig pure (decide (__do_lift.ematch.numInstances ≥ __do_lift_1.instances))
Instances For
Returns true if the maximum number of case-splits has been reached.
Equations
Instances For
Returns true if the maximum number of E-matching rounds has been reached.
Equations
Instances For
Equations
- Lean.Meta.Grind.throwNonInternalizedExpr e = Lean.throwError (Lean.toMessageData "internal `grind` error, term has not been internalized" ++ Lean.toMessageData (Lean.indentExpr e))
Instances For
Equations
- goal.getGeneration e = match goal.getENode? e with | some n => n.generation | x => 0
Instances For
Returns the generation of the given term. Is assumes it has been internalized
Equations
- Lean.Meta.Grind.getGeneration e = do let __do_lift ← get pure (__do_lift.getGeneration e)
Instances For
Returns true if e is in the equivalence class of True.
Equations
- Lean.Meta.Grind.isEqTrue e = do let __do_lift ← Lean.Meta.Grind.getENode e let __do_lift_1 ← liftM Lean.Meta.Grind.getTrueExpr pure (Lean.Meta.Grind.isSameExpr __do_lift.root __do_lift_1)
Instances For
Returns true if e is in the equivalence class of False.
Equations
- Lean.Meta.Grind.isEqFalse e = do let __do_lift ← Lean.Meta.Grind.getENode e let __do_lift_1 ← liftM Lean.Meta.Grind.getFalseExpr pure (Lean.Meta.Grind.isSameExpr __do_lift.root __do_lift_1)
Instances For
Returns true if e is in the equivalence class of Bool.false.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns true if a and b are in the same equivalence class.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns true if the root of its equivalence class.
Equations
- Lean.Meta.Grind.isRoot e = do let __discr ← Lean.Meta.Grind.getENode? e match __discr with | some n => pure (Lean.Meta.Grind.isSameExpr n.root e) | x => pure false
Instances For
Returns the root enode in the equivalence class of e.
Equations
- Lean.Meta.Grind.getRootENode e = do let __do_lift ← Lean.Meta.Grind.getRoot e Lean.Meta.Grind.getENode __do_lift
Instances For
Returns the root enode in the equivalence class of e if it is in an equivalence class.
Equations
- Lean.Meta.Grind.getRootENode? e = do let __discr ← Lean.Meta.Grind.getENode? e match __discr with | some n => Lean.Meta.Grind.getENode? n.root | x => pure none
Instances For
Returns true if e has already been internalized.
Equations
- Lean.Meta.Grind.alreadyInternalized e = do let __do_lift ← get pure (Lean.PersistentHashMap.contains __do_lift.enodeMap { expr := e })
Instances For
Equations
- Lean.Meta.Grind.getTarget? e = do let __do_lift ← get pure (__do_lift.getTarget? e)
Instances For
Return true if a and b have the same type.
Equations
- Lean.Meta.Grind.hasSameType a b = do let __do_lift ← Lean.Meta.inferType a let __do_lift_1 ← Lean.Meta.inferType b Lean.Meta.Grind.isDefEqD __do_lift __do_lift_1
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pushes lhs = rhs with proof to newEqs.
Equations
- Lean.Meta.Grind.pushEq lhs rhs proof = Lean.Meta.Grind.pushEqCore lhs rhs proof false
Instances For
Pushes lhs ≍ rhs with proof to newEqs.
Equations
- Lean.Meta.Grind.pushHEq lhs rhs proof = Lean.Meta.Grind.pushEqCore lhs rhs proof true
Instances For
Pushes a = True with proof to newEqs.
Equations
- Lean.Meta.Grind.pushEqTrue a proof = do let __do_lift ← liftM Lean.Meta.Grind.getTrueExpr Lean.Meta.Grind.pushEq a __do_lift proof
Instances For
Pushes a = False with proof to newEqs.
Equations
- Lean.Meta.Grind.pushEqFalse a proof = do let __do_lift ← liftM Lean.Meta.Grind.getFalseExpr Lean.Meta.Grind.pushEq a __do_lift proof
Instances For
Pushes a = Bool.true with proof to newEqs.
Equations
- Lean.Meta.Grind.pushEqBoolTrue a proof = do let __do_lift ← liftM Lean.Meta.Grind.getBoolTrueExpr Lean.Meta.Grind.pushEq a __do_lift proof
Instances For
Pushes a = Bool.false with proof to newEqs.
Equations
- Lean.Meta.Grind.pushEqBoolFalse a proof = do let __do_lift ← liftM Lean.Meta.Grind.getBoolFalseExpr Lean.Meta.Grind.pushEq a __do_lift proof
Instances For
Records that parent is a parent of child. This function actually stores the
information in the root (aka canonical representative) of child.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns true if type of t is definitionally equal to α
Equations
- Lean.Meta.Grind.hasType t α = do let __do_lift ← Lean.Meta.inferType t Lean.Meta.Grind.isDefEqD __do_lift α
Instances For
Returns true is e is the root of its congruence class.
Equations
- Lean.Meta.Grind.isCongrRoot e = do let __do_lift ← Lean.Meta.Grind.getENode e pure __do_lift.isCongrRoot
Instances For
Return true if the goal is inconsistent.
Equations
- Lean.Meta.Grind.isInconsistent = do let __do_lift ← get pure __do_lift.inconsistent
Instances For
Returns a proof that a = b.
It assumes a and b are in the same equivalence class, and have the same type.
Returns a proof that a ≍ b.
It assumes a and b are in the same equivalence class.
Returns a proof that a = b if they have the same type. Otherwise, returns a proof of a ≍ b.
It assumes a and b are in the same equivalence class.
Equations
- Lean.Meta.Grind.mkEqHEqProof a b = do let __do_lift ← liftM (Lean.Meta.Grind.hasSameType a b) if __do_lift = true then Lean.Meta.Grind.mkEqProof a b else Lean.Meta.Grind.mkHEqProof a b
Instances For
Returns a proof that a = True.
It assumes a and True are in the same equivalence class.
Equations
- Lean.Meta.Grind.mkEqTrueProof a = do let __do_lift ← liftM Lean.Meta.Grind.getTrueExpr Lean.Meta.Grind.mkEqProof a __do_lift
Instances For
Returns a proof that a = False.
It assumes a and False are in the same equivalence class.
Equations
- Lean.Meta.Grind.mkEqFalseProof a = do let __do_lift ← liftM Lean.Meta.Grind.getFalseExpr Lean.Meta.Grind.mkEqProof a __do_lift
Instances For
Returns a proof that a = Bool.true.
It assumes a and Bool.true are in the same equivalence class.
Equations
- Lean.Meta.Grind.mkEqBoolTrueProof a = do let __do_lift ← liftM Lean.Meta.Grind.getBoolTrueExpr Lean.Meta.Grind.mkEqProof a __do_lift
Instances For
Returns a proof that a = Bool.false.
It assumes a and Bool.false are in the same equivalence class.
Equations
- Lean.Meta.Grind.mkEqBoolFalseProof a = do let __do_lift ← liftM Lean.Meta.Grind.getBoolFalseExpr Lean.Meta.Grind.mkEqProof a __do_lift
Instances For
Marks current goal as inconsistent without assigning mvarId.
Equations
- One or more equations did not get rendered due to their size.
Instances For
goal.withContext x executes x using the given metavariable LocalContext and LocalInstances.
The type class resolution cache is flushed when executing x if its LocalInstances are
different from the current ones.
Equations
- goal.withContext = goal.mvarId.withContext
Instances For
Returns all enodes in the goal
Equations
- Lean.Meta.Grind.getExprs = do let __do_lift ← get pure __do_lift.exprs
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lean.Meta.Grind.EvalTactic.skip goal x✝ = pure [goal]
Instances For
- propagateUp : Propagator
- propagateDown : Propagator
- evalTactic : EvalTactic
Instances For
Equations
Equations
Instances For
Instances For
Equations
- Lean.Meta.Grind.getMethods = do let __do_lift ← Lean.Meta.Grind.getMethodsRef pure (Lean.Meta.Grind.MethodsRef.toMethods✝ __do_lift)
Instances For
Equations
- Lean.Meta.Grind.propagateUp e = do let __do_lift ← liftM Lean.Meta.Grind.getMethods __do_lift.propagateUp e
Instances For
Equations
- Lean.Meta.Grind.propagateDown e = do let __do_lift ← liftM Lean.Meta.Grind.getMethods __do_lift.propagateDown e
Instances For
Equations
- Lean.Meta.Grind.evalTactic goal stx = do let __do_lift ← Lean.Meta.Grind.getMethods __do_lift.evalTactic goal stx
Instances For
Returns true if s has been already added to the case-split list at one point.
Remark: this function returns true even if the split has already been resolved
and is not in the list anymore.
Equations
Instances For
Returns true if e is a case-split that does not need to be performed anymore.
Equations
- Lean.Meta.Grind.isResolvedCaseSplit e = do let __do_lift ← get pure (Lean.PersistentHashSet.contains __do_lift.split.resolved { expr := e })
Instances For
Marks e as a case-split that does not need to be performed anymore.
Remark: we currently use this feature to disable match-case-splits.
Remark: we also use this feature to record the case-splits that have already been performed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns extensionality theorems for the given type if available.
If Config.ext is false, the result is #[].
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add a new lookahead candidate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Action is the control interface for grind’s search steps. It is defined in
Continuation-Passing Style (CPS).
See Grind/Action.lean for additional details.
Result type for a grind Action
- closed
(seq : List TGrind)
 : ActionResultThe goal has been closed, and you can use seqto close the goal efficiently.
- stuck
(gs : List Goal)
 : ActionResultThe action could not make further progress. gsare subgoals that could not be closed. They are used for producing error messages.
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lean.Meta.Grind.Action.notApplicable goal kna x✝ = kna goal
Instances For
Equations
Solver Extensions
Solver extension, can only be generated by registerSolverExtension that allocates a unique index
for this extension into each goal's extension state's array.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Registers a new solver extension for grind.
Solver extensions can only be registered during initialization.
Reason: We do not use any synchronization primitive to access solverExtensionsRef.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Sets methods/handlers for solver extension ext.
Solver extension methods can only be registered during initialization.
Reason: We do not use any synchronization primitive to access solverExtensionsRef.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns initial state for registered solvers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.Grind.instInhabitedGoalM = { default := Lean.throwError (Lean.toMessageData "<GoalM action default value>") }
Equations
- ext.getState = do let __do_lift ← get liftM (ext.getStateCore __do_lift)
Instances For
Checks invariants of all registered solvers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.Grind.Solvers.check = do let __do_lift ← Lean.Meta.Grind.Solvers.check? pure !__do_lift.isNone
Instances For
Invokes model-based theory combination extensions in all registered solvers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Sequential conjunction: executes both x and y.
- Runs xand always runsyafterward, regardless of whetherxmade progress.
- It is not applicable only if both xandyare not applicable.
Equations
- x.andAlso y goal kna kp = x goal (fun (goal : Lean.Meta.Grind.Goal) => y goal kna kp) fun (goal : Lean.Meta.Grind.Goal) => y goal kp kp
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a new disequality lhs ≠ rhs, propagates it to relevant theories.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns some t if t is the solver term for ext associated with e.
Equations
- ext.getTerm e = Lean.Meta.Grind.SolverExtension.getTerm.go✝ ext.id e.sTerms
Instances For
Returns true if the root of es equivalence class is already attached to a term
of the given solver.
Equations
- ext.hasTermAtRoot e = do let __do_lift ← Lean.Meta.Grind.getRootENode e pure (Lean.Meta.Grind.SolverExtension.hasTermAtRoot.go✝ ext.id __do_lift.sTerms)
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Meta.Grind.anchorPrefixToString numDigits anchorPrefix = (List.replicate (numDigits - (Nat.toDigits 16 anchorPrefix.toNat).length) '0' ++ Nat.toDigits 16 anchorPrefix.toNat).asString
Instances For
Equations
- Lean.Meta.Grind.anchorToString numDigits anchor = Lean.Meta.Grind.anchorPrefixToString numDigits (anchor >>> (64 - 4 * numDigits.toUInt64))
Instances For
Returns activated match-declaration equations.
Recall that in tactics such as instantiate only [...], match-declarations are always instantiated.
Equations
- One or more equations did not get rendered due to their size.