Node IDs #
- toNat : Nat
Equations
- Aesop.GoalId.instLT = { lt := fun (n m : Aesop.GoalId) => n.toNat < m.toNat }
Equations
- n.instDecidableRelLt m = inferInstanceAs (Decidable (n.toNat < m.toNat))
Equations
- Aesop.GoalId.instToString = { toString := fun (n : Aesop.GoalId) => toString n.toNat }
Equations
- Aesop.GoalId.instHashable = { hash := fun (n : Aesop.GoalId) => hash n.toNat }
Rule Application IDs #
- toNat : Nat
Equations
- Aesop.RappId.instLT = { lt := fun (n m : Aesop.RappId) => n.toNat < m.toNat }
Equations
- n.instDecidableRelLt m = inferInstanceAs (Decidable (n.toNat < m.toNat))
Equations
- Aesop.RappId.instToString = { toString := fun (n : Aesop.RappId) => toString n.toNat }
Equations
- Aesop.RappId.instHashable = { hash := fun (n : Aesop.RappId) => hash n.toNat }
Iterations #
Equations
Equations
Equations
Equations
Equations
Equations
- Aesop.Iteration.instDecidableRelLt = inferInstanceAs (DecidableRel fun (x1 x2 : Nat) => x1 < x2)
Equations
- Aesop.Iteration.instDecidableRelLe = inferInstanceAs (DecidableRel fun (x1 x2 : Nat) => x1 ≤ x2)
The Tree #
At each point during the search, every node of the tree (goal, rapp or mvar cluster) is in one of these states:
proven: the node is proven.unprovable: the node is unprovable, i.e. it will never be proven regardless of any future expansions that might be performed.unknown: neither of the above.
Every node starts in the unknown state and may later become either proven or
unprovable. After this, the state does not change any more.
Equations
- Aesop.instInhabitedNodeState = { default := Aesop.NodeState.unknown }
Equations
- Aesop.instBEqNodeState = { beq := Aesop.beqNodeState✝ }
Equations
- One or more equations did not get rendered due to their size.
A refinement of the NodeState, distinguishing between goals proven during
normalisation and goals proven by a child rule application.
Equations
- Aesop.instInhabitedGoalState = { default := Aesop.GoalState.unknown }
Equations
- Aesop.instBEqGoalState = { beq := Aesop.beqGoalState✝ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- notNormal : NormalizationState
- normal (postGoal : Lean.MVarId) (postState : Lean.Meta.SavedState) (script : Array (DisplayRuleName × Option (Array Script.LazyStep))) : NormalizationState
- provenByNormalization (postState : Lean.Meta.SavedState) (script : Array (DisplayRuleName × Option (Array Script.LazyStep))) : NormalizationState
Instances For
Equations
Equations
- Aesop.NormalizationState.notNormal.isNormal = false
- (Aesop.NormalizationState.normal postGoal postState script).isNormal = true
- (Aesop.NormalizationState.provenByNormalization postState script).isNormal = true
Equations
- Aesop.NormalizationState.notNormal.isProvenByNormalization = false
- (Aesop.NormalizationState.normal postGoal postState script).isProvenByNormalization = false
- (Aesop.NormalizationState.provenByNormalization postState script).isProvenByNormalization = true
Equations
- Aesop.NormalizationState.notNormal.normalizedGoal? = none
- (Aesop.NormalizationState.provenByNormalization postState script).normalizedGoal? = none
- (Aesop.NormalizationState.normal g postState script).normalizedGoal? = some g
A goal G can be added to the tree for three reasons:
Gwas produced by its parent rule as a subgoal. This is the most common reason.Gwas copied because it contains some metavariables which were assigned by its parent rule. In this case, we record goal of whichGis a copy. We also record the representative of the equivalence class of goals which are copies of each other. E.g. if goal1is copied to goal2and goal2is copied to goal3, they are all part of the equivalence class with representative1.
- subgoal : GoalOrigin
- copied («from» rep : GoalId) : GoalOrigin
- droppedMVar : GoalOrigin
Instances For
Equations
- Aesop.instInhabitedGoalOrigin = { default := Aesop.GoalOrigin.subgoal }
Equations
- (Aesop.GoalOrigin.copied «from» rep).originalGoalId? = some rep
- x✝.originalGoalId? = none
- id : GoalId
- parent : IO.Ref MVarCluster
- origin : GoalOrigin
- depth : Nat
- state : GoalState
- isIrrelevant : Bool
- isForcedUnprovable : Bool
- preNormGoal : Lean.MVarId
- normalizationState : NormalizationState
- mvars : UnorderedArraySet Lean.MVarId
- forwardState : ForwardState
The forward state reflects the local context of the current goal. Before normalisation, this is the local context of
preNormGoal; after normalisation, it is the local context of the post-normalisation goal (unless normalisation solved the goal, in which case the forward state is undetermined). - forwardRuleMatches : ForwardRuleMatches
Complete matches of forward rules for the current goal (in the same sense as above).
- successProbability : Percent
- addedInIteration : Iteration
- lastExpandedInIteration : Iteration
- unsafeRulesSelected : Bool
- unsafeQueue : UnsafeQueue
- failedRapps : Array RegularRule
Instances For
- id : RappId
- parent : IO.Ref Goal
- state : NodeState
- isIrrelevant : Bool
- appliedRule : RegularRule
- scriptSteps? : Option (Array Script.LazyStep)
- originalSubgoals : Array Lean.MVarId
- successProbability : Percent
- metaState : Lean.Meta.SavedState
- introducedMVars : UnorderedArraySet Lean.MVarId
- assignedMVars : UnorderedArraySet Lean.MVarId
Instances For
- mk (d : GoalData RappUnsafe MVarClusterUnsafe) : GoalUnsafe
- mk (d : MVarClusterData GoalUnsafe RappUnsafe) : MVarClusterUnsafe
- mk (d : RappData GoalUnsafe MVarClusterUnsafe) : RappUnsafe
- Goal : Type
- Rapp : Type
- MVarCluster : Type
- introGoal : GoalData self.Rapp self.MVarCluster → self.Goal
- elimGoal : self.Goal → GoalData self.Rapp self.MVarCluster
- introRapp : RappData self.Goal self.MVarCluster → self.Rapp
- elimRapp : self.Rapp → RappData self.Goal self.MVarCluster
- introMVarCluster : MVarClusterData self.Goal self.Rapp → self.MVarCluster
- elimMVarCluster : self.MVarCluster → MVarClusterData self.Goal self.Rapp
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
Equations
Equations
Instances For
Equations
Equations
Equations
Equations
- Aesop.MVarCluster.modify f c = Aesop.MVarCluster.mk (f c.elim)
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.
Equations
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.
Equations
Equations
Equations
- Aesop.Goal.modify f g = Aesop.Goal.mk (f g.elim)
Equations
Equations
Equations
- g.preNormGoal = g.elim.preNormGoal
Equations
Equations
Equations
Equations
Equations
Equations
Equations
- g.failedRapps = g.elim.failedRapps
Equations
Equations
- g.unsafeQueue = g.elim.unsafeQueue
Equations
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.
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.
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.
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.
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.
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.
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.
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.
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.
Equations
- Aesop.Goal.instBEq = { beq := fun (g₁ g₂ : Aesop.Goal) => g₁.id == g₂.id }
Equations
- Aesop.Goal.instHashable = { hash := fun (g : Aesop.Goal) => hash g.id }
Equations
Equations
Equations
- Aesop.Rapp.modify f r = Aesop.Rapp.mk (f r.elim)
Equations
Equations
- r.appliedRule = r.elim.appliedRule
Equations
Equations
Equations
Equations
Equations
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.
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.
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.
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.
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.
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.
Equations
- Aesop.Rapp.instBEq = { beq := fun (r₁ r₂ : Aesop.Rapp) => r₁.id == r₂.id }
Equations
- Aesop.Rapp.instHashable = { hash := fun (r : Aesop.Rapp) => hash r.id }
Miscellaneous Queries #
Equations
- r.isSafe = (r.appliedRule.isSafe && r.assignedMVars.isEmpty)
Equations
- g.postNormGoalAndMetaState? = match g.normalizationState with | Aesop.NormalizationState.normal postGoal postState script => some (postGoal, postState) | x => none
Equations
- g.postNormGoal? = Option.map (fun (x : Lean.MVarId × Lean.Meta.SavedState) => x.fst) g.postNormGoalAndMetaState?
Equations
- g.currentGoal = g.postNormGoal?.getD g.preNormGoal
Equations
- g.parentRapp? = do let __do_lift ← ST.Ref.get g.parent pure __do_lift.parent?
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.
Equations
- g.safeRapps = Array.filterM (fun (rref : Aesop.RappRef) => do let __do_lift ← ST.Ref.get rref pure __do_lift.isSafe) g.children
Equations
- g.hasSafeRapp = Array.anyM (fun (rref : Aesop.RappRef) => do let __do_lift ← ST.Ref.get rref pure __do_lift.isSafe) g.children
Equations
Equations
- g.isExhausted = (pure g.isUnsafeExhausted <||> g.hasSafeRapp)
Equations
- g.isActive = do let __do_lift ← pure g.isIrrelevant <||> g.isExhausted pure !__do_lift
Equations
- g.hasProvableRapp = Array.anyM (fun (r : Aesop.RappRef) => do let __do_lift ← ST.Ref.get r pure !__do_lift.state.isUnprovable) g.children
Equations
Equations
- g.originalGoalId = g.origin.originalGoalId?.getD g.id
Equations
- g.isRoot = do let __do_lift ← g.parentRapp? pure __do_lift.isNone
Equations
Equations
- r.parentPostNormMetaState rootMetaState = do let __do_lift ← ST.Ref.get r.parent __do_lift.parentMetaState rootMetaState
Equations
- One or more equations did not get rendered due to their size.
Equations
- Aesop.Rapp.forSubgoalsM f r = Array.forM (fun (cref : Aesop.MVarClusterRef) => do let __do_lift ← ST.Ref.get cref Array.forM f __do_lift.goals) r.children
Equations
- r.subgoals = Aesop.Rapp.foldSubgoalsM #[] (fun (subgoals : Array Aesop.GoalRef) (gref : Aesop.GoalRef) => pure (subgoals.push gref)) r
Equations
- c.provenGoal? = Array.findM? (fun (gref : Aesop.GoalRef) => do let __do_lift ← ST.Ref.get gref pure __do_lift.state.isProven) c.goals