- GreaterThan : Comparison
- LessThan : Comparison
- Equal : Comparison
- Incomparable : Comparison
Instances For
Equations
Equations
- Duper.instInhabitedComparison = { default := Duper.Comparison.GreaterThan }
- FVarId : Lean.FVarId → Symbol
- Const : Lean.Name → Symbol
Instances For
Equations
- Duper.instBEqSymbol = { beq := Duper.beqSymbol✝ }
Equations
- Duper.instInhabitedSymbol = { default := Duper.Symbol.FVarId default }
Equations
- Duper.instHashableSymbol = { hash := Duper.hashSymbol✝ }
Equations
- (Duper.Symbol.FVarId a).format = Lean.toMessageData "FVarId " ++ Lean.toMessageData a.name ++ Lean.toMessageData ""
- (Duper.Symbol.Const a).format = Lean.toMessageData "Const " ++ Lean.toMessageData a ++ Lean.toMessageData ""
Instances For
Equations
- Duper.instToMessageDataSymbol = { toMessageData := Duper.Symbol.format }
Equations
- Duper.instToStringSymbol = { toString := Duper.Symbol.toString }
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
Equations
Instances For
Equations
- vb.addPosVar t = Std.HashMap.insert vb t (Std.HashMap.getD vb t 0 + 1)
Instances For
Equations
- vb.addNegVar t = Std.HashMap.insert vb t (Std.HashMap.getD vb t 0 - 1)
Instances For
Equations
- Duper.Order.getHead (Lean.Expr.lam binderName binderType body binderInfo) = Lean.mkConst `Duper.Order.LAM
- Duper.Order.getHead (Lean.Expr.forallE binderName binderType body binderInfo) = Lean.mkConst `Duper.Order.FORALL
- Duper.Order.getHead (((Lean.Expr.const `Exists us).app arg).app arg_1) = Lean.mkConst `Duper.Order.EXISTS
- Duper.Order.getHead (Lean.Expr.mdata data t_2) = Duper.Order.getHead t_2
- Duper.Order.getHead t = t.getAppFn'
Instances For
Equations
- Duper.Order.getArgs (Lean.Expr.lam binderName binderType body binderInfo) = [binderType, body]
- Duper.Order.getArgs (Lean.Expr.forallE binderName binderType body binderInfo) = [binderType, body]
- Duper.Order.getArgs (((Lean.Expr.const `Exists us).app arg).app (Lean.Expr.lam binderName binderType b_1 binderInfo)) = [arg, b_1]
- Duper.Order.getArgs (((Lean.Expr.const `Exists us).app arg).app arg_1) = [arg, (arg_1.liftLooseBVars 0 1).app (Lean.Expr.bvar 0)]
- Duper.Order.getArgs (Lean.Expr.mdata data t_2) = Duper.Order.getArgs t_2
- Duper.Order.getArgs t = t.getAppArgs.toList
Instances For
Computes headWeight according to firstmaximal0 weight generation scheme. The head is given weight 1 unless if the head is the unique symbol with the highest precedence in symbolPrecMap, in which case, it is given weight 0.
Note: In order to make the firstmaximal0 weight generation scheme compliant with KBO, if the highest precedence symbol has arity 0 (i.e. is a first-order 'constant'), then I cannot assign the highest precedence symbol weight 0 (because this would violate KBO's constraint that all first-order 'constants' share some positive weight μ). In this case, I simply assign the highest precedence symbol weight 1, as with everything else.
Equations
- One or more equations did not get rendered due to their size.
- Duper.Order.headWeight (Lean.Expr.mvar mvarId) symbolPrecMap highesetPrecSymbolHasArityZero belowLam = 1
- Duper.Order.headWeight (Lean.Expr.bvar deBruijnIndex) symbolPrecMap highesetPrecSymbolHasArityZero belowLam = 1
- Duper.Order.headWeight (Lean.Expr.sort u) symbolPrecMap highesetPrecSymbolHasArityZero belowLam = 1
- Duper.Order.headWeight (Lean.Expr.lit a) symbolPrecMap highesetPrecSymbolHasArityZero belowLam = 1
- Duper.Order.headWeight (Lean.Expr.proj typeName idx struct) symbolPrecMap highesetPrecSymbolHasArityZero belowLam = 1
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
A last resort comparison function to use if symbolPrecCompare needs to compare two symbols, neither of which appeared in symbolPrecMap. We use the convention: Anonymous < Num < Str
Equations
- One or more equations did not get rendered due to their size.
- Duper.Order.nameCompare Lean.Name.anonymous Lean.Name.anonymous = Duper.Comparison.Equal
- Duper.Order.nameCompare (pre1.str s1) (pre2.str s2) = if s1 < s2 then Duper.Comparison.LessThan else if s1 > s2 then Duper.Comparison.GreaterThan else Duper.Order.nameCompare pre1 pre2
- Duper.Order.nameCompare Lean.Name.anonymous (pre.num i) = Duper.Comparison.LessThan
- Duper.Order.nameCompare Lean.Name.anonymous (pre.str str) = Duper.Comparison.LessThan
- Duper.Order.nameCompare (pre.num i) Lean.Name.anonymous = Duper.Comparison.GreaterThan
- Duper.Order.nameCompare (pre.num i) (pre_1.str str) = Duper.Comparison.LessThan
- Duper.Order.nameCompare (pre.str str) Lean.Name.anonymous = Duper.Comparison.GreaterThan
- Duper.Order.nameCompare (pre.str str) (pre_1.num i) = Duper.Comparison.GreaterThan
Instances For
A comparison function for comparing fvars and consts based on precomputed precedences. Note that lower numbers in symbolPrecMap correspond to higher precedences. e1 is the expression that produces symbol s1 and e2 is the expression that produces symbol s2 (e1 and e2 need to be included in addition to s1 and s2 in case if we need to determine the arity of e1 or e2)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Overapproximation of being fluid
Equations
Instances For
Higher-Order KBO, inspired by https://github.com/sneeuwballen/zipperposition/blob/master/src/core/Ordering.ml
.
Follows Section 3.9 of https://matryoshka-project.github.io/pubs/hosup_article.pdf
and the article "Things to Know when Implementing KBO" by Bernd Löchner.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Update variable balance, weight balance, and check whether the term contains the fluid term s.
The argument pos
determines whether weights and variables will be counted positively or negatively,
i.e., whether t
is the left term in the comparison. Returns the weight balance and whether s
was found.
balance_weight for the case where t is an applied variable
Equations
- One or more equations did not get rendered due to their size.
Instances For
list version of the previous one, threaded with the check result
lexicographic comparison
length-lexicographic comparison
tupled version of kbo (kbo_5 of the paper)
tckbo, for non-variable-headed terms).
recursive comparison
getLitNetWeight takes two expressions t1
and t2
and calculates weight(t1) - weight(t2)
, returning the difference of
the two expressions' weights.
Equations
- One or more equations did not get rendered due to their size.