Return true when e corresponds to the one nat literal.
Equations
- Blaster.Optimize.isOneNat e = match Blaster.Optimize.isNatValue? e with | some 1 => true | x => false
Instances For
Given op1 and op2 corresponding to the operands for LT.lt:
- return
some Falsewhenop1 := N + e ∧ op2 := e ∧ N > 0 ∧ Type(N) = Int - return
some Truewhenop1 := N + e ∧ op2 := e ∧ N < 0 ∧ Type(N) = Int - return
some Falsewhenop1 := a + b ∧ op2 := a ∧ Type(N) = Int ∧ geqZeroIntInHyps b - return
some Falsewhenop1 := b + a ∧ op2 := a ∧ Type(N) = Int ∧ geqZeroIntInHyps b - return
some Truewhenop1 := a + b ∧ op2 := a ∧ Type(N) = Int ∧ ltZeroIntInHyps b - return
some Truewhenop1 := b + a ∧ op2 := a ∧ Type(N) = Int ∧ ltZeroIntInHyps bOtherwisenone.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given op1 and op2 corresponding to the operands for LT.lt:
- return
some Truewhenop1 := e ∧ op2 := N + e ∧ N > 0 ∧ Type(N) = Int - return
some Falsewhenop1 := e ∧ op2 := N + e ∧ N < 0 ∧ Type(N) = Int - return
some Falsewhenop1 := a ∧ op2 := a + b ∧ Type(a) = Int ∧ leqZeroIntInHyps b - return
some Falsewhenop1 := a ∧ op2 := b + a ∧ Type(a) = Int ∧ leqZeroIntInHyps b - return
some Truewhenop1 := a ∧ op2 := a + b ∧ Type(a) = Int ∧ gtZeroIntInHyps b - return
some Truewhenop1 := a ∧ op2 := b + a ∧ Type(a) = Int ∧ gtZeroIntInHyps bOtherwisenone.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given op1 and op2 corresponding to the operands for LT.lt:
- return
some Truewhenop1 := e ∧ op2 := N + e ∧ N > 0 ∧ Type(N) = Nat - return
some Falsewhenop1 := a ∧ op2 := a + b ∧ Type(a) = Nat ∧ eqZeroNatInHyps b - return
some Falsewhenop1 := a ∧ op2 := b + a ∧ Type(a) = Nat ∧ eqZeroNatInHyps b - return
some Truewhenop1 := a ∧ op2 := a + b ∧ Type(a) = Nat ∧ gtZeroNatInHyps b - return
some Truewhenop1 := a ∧ op2 := b + a ∧ Type(a) = Nat ∧ gtZeroNatInHyps bOtherwisenone.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given op1 and op2 corresponding to the operands for LT.lt:
- return
some (N1 "<" N2)whenop1 := N1 ∧ op2 := N2 ∧ Type(op1) = Nat - return
some (N1 "<" N2)whenop1 := N1 ∧ op2 := N2 ∧ Type(op1) = Int - return
some (S1 "<" S2)whenop1 := S1 ∧ op2 := S2 ∧ Type(op1) = StringNOTE: This function need to be updated each time we are opacifying other Lean inductive types. Otheriwsenone.
Equations
- One or more equations did not get rendered due to their size.
- Blaster.Optimize.cstLTProp? (Lean.Expr.lit (Lean.Literal.natVal n1)) (Lean.Expr.lit (Lean.Literal.natVal n2)) = do let a ← Blaster.Optimize.mkPropLit (n1.blt n2) pure (some a)
- Blaster.Optimize.cstLTProp? (Lean.Expr.lit (Lean.Literal.strVal s1)) (Lean.Expr.lit (Lean.Literal.strVal s2)) = do let a ← Blaster.Optimize.mkPropLit (decide (s1 < s2)) pure (some a)
Instances For
Given op1 and op2 corresponding to the operands for LT.lt:
- return
some b < 0whenop1 := 0∧ op2 := -b ∧ Type(op1) = IntOtherwisenone`.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given op1 and op2 corresponding to the operands for LT.lt such that,
op1 := N1 + a, op2 := N2 and Type(a) = Int`:
- return
some a < N2 "-" N1Otherwisenone.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given op1 and op2 corresponding to the operands for LT.lt such that,
op1 := N1, op2 := N2 + a and Type(a) = Int`:
- return
some N1 "-" N2 < aOtherwisenone.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given op1 and op2 corresponding to the operands for LT.lt,
return true only when the following conditions are satisfied
op1 := N∧- ¬ (N - 1 < op2) _ ∈ hypothesisContext.hypothesisMap ∧
- Type(op2) ∈ [Nat, Int]
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply the following simplification/normalization rules on LT.lt :
- e1 < e2 ==> False (if e1 =ₚₜᵣ e2)
- e < 0 ==> False (if Type(e) = Nat)
- 0 < -e ==> e < 0 (if Type(e) = Int)
- N1 < N2 ==> N1 "<" N2
- N < e ==> False (if ¬ (N - 1 < e) := _ ∈ hypothesisContext.hypothesisMap ∧ Type(e) ∈ [Nat, Int])
- e < 1 ==> 0 = e (if Type(e) = Nat)
- a + b < a | b + a < a ==> False (if Type(a) = Nat)
- N + e < e ==> False (if N > 0 ∧ Type(e) = Int)
- N + e < e ==> True (if N < 0 ∧ Type(e) = Int)
- a + b < a | b + a < a ==> False (if Type(a) = Int ∧ geqZeroIntInHyps b)
- a + b < a | b + a < a ==> True (if Type(a) = Int ∧ ltZeroIntInHyps b)
- e < N + e ==> True (if N > 0 ∧ Type(N) ∈ [Nat, Int])
- e < N + e ==> False (if N < 0 ∧ Type(N) = Int)
- a < a + b | a < b + a ==> False (if Type(a) = Nat ∧ eqZeroNatInHyps b)
- a < a + b | a < b + a ==> True (if Type(a) = Nat ∧ gtZeroNatInHyps b)
- a < a + b | a < b + a ==> False (if Type(a) = Int ∧ leqZeroIntInHyps b)
- a < a + b | a < b + a ==> True (if Type(a) = Int ∧ gtZeroIntInHyps b)
- N1 + a < N2 ==> False (if Type(a) = Nat ∧ N2 ≤ N1)
- N1 + a < N2 ==> a < N2 "-" N1 (if Type(a) = Nat ∧ N2 > N1)
- N1 + a < N2 ==> a < N2 "-" N1 (if Type(a) = Int)
- N1 < N2 + a ==> True (if Type(a) = Nat ∧ N1 < N2)
- N1 < N2 + a ==> N1 "-" N2 < a (if Type(a) = Nat ∧ N1 ≥ N2)
- N1 < N2 + a ==> N1 "-" N2 < a (if Type(a) = Int)
- N1 + a < N2 + b ==> N1 "-" min(N1, N2) + a < N2 "-" min(N1, N2) + b (if Type(a) ∈ [Nat, Int])
- a < 1 + b ==> ¬ (b < a) (if Type(a) ∈ [Nat, Int]) The simplifications are only applied when isOpaqueRelational predicate is satisfied Assume that f = Expr.const ``LT.lt. Do nothing if operator is partially applied (i.e., args.size < 4)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given op1 and op2 corresponding to the operands for LT.lt such that,
op1 := N1 + a, op2 := N2 + b and Type(a) = Nat`:
- return
some N1 "-" min(N1, N2) + a < N2 "-" min(N1, N2) + bOtherwisenone
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given op1 and op2 corresponding to the operands for LT.lt such that,
op1 := N1 + a, op2 := N2 + b and Type(a) = Int`:
- return
some N1 "-" min(N1, N2) + a < N2 "-" min(N1, N2) + bOtherwisenone
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply the following snormalization rule on LE.le :
- e1 ≤ e2 ==> ¬ (e2 < e1)
This normalization rule is applied only when isOpaqueRelational predicate is satisfied Assume that f = Expr.const ``LE.le.
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
Apply simplification and normalization rules on LE.le and LT.lt :
Equations
- Blaster.Optimize.optimizeRelational? (Lean.Expr.const `LE.le us) args = do let a ← Blaster.Optimize.optimizeLE (Lean.Expr.const `LE.le us) args pure (some a)
- Blaster.Optimize.optimizeRelational? (Lean.Expr.const `LT.lt us) args = do let a ← Blaster.Optimize.optimizeLT (Lean.Expr.const `LT.lt us) args pure (some a)
- Blaster.Optimize.optimizeRelational? (Lean.Expr.const n us) args = pure none
- Blaster.Optimize.optimizeRelational? f args = pure none