@[inline]
Return true when e corresponds to the zero nat literal.
Equations
- Blaster.Optimize.isZeroNat e = match Blaster.Optimize.isNatValue? e with | some 0 => true | x => false
Instances For
Given ne the operand for Not apply the following normalization rules:
- When
ne := false = e- return
some (true = e)
- return
- When
ne := true = e- return
some (false = e)
- return
- Otherwise:
- return
none.
- return
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given ne the operand for Not, apply the following normalization rule:
- When
ne := 0 < e∧ Type(a) = Nat:- return
some (0 = e)
- return
- Otherwise:
- return
none
- return
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Blaster.Optimize.optimizeNot
(f : Lean.Expr)
(args : Array Lean.Expr)
(cacheResult : Bool := true)
:
Apply the following simplification/normalization rules on Not :
- ¬ False ==> True
- ¬ True ==> False
- ¬ (¬ e) ==> e (classical)
- ¬ (false = e) ==> true = e
- ¬ (true = e) ==> false = e
- ¬ (0 < e) ==> (0 = e) (if Type(e) = Nat)
Assume that f = Expr.const ``Not.
An error is triggered if args.size ≠ 1 (i.e., only fully applied
Notexpected at this stage) TODO: consider additional simplification rules
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given ne the operand for Not apply the following normalization rules:
- When
ne := ¬ e1 ∧ ¬ e2- return
e1 ∨ e2
- return
- When
ne := ¬ e1 ∨ ¬ e2- return
e1 ∧ e2
- return
- Otherwise:
- return
none.
- return
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
Call optimizeNot f args and apply the following simplification/normalization rules on Not :
- ¬ (¬ e1 ∧ ¬ e2) ==> (e1 ∨ e2)
- ¬ (¬ e1 ∨ ¬ e2) ==> (e1 ∧ e2)
Assume that f = Expr.const ``Not.
An error is triggered if args.size ≠ 1 (i.e., only fully applied
Notexpected at this stage)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply simplification and normalization rules on proposition Not formulae.
Equations
- Blaster.Optimize.optimizePropNot? (Lean.Expr.const `Not us) args = do let a ← Blaster.Optimize.optimizeAdvancedNot (Lean.Expr.const `Not us) args pure (some a)
- Blaster.Optimize.optimizePropNot? f args = pure none