refactor: remove redundant condition

This commit is contained in:
Formally Verified Waffle Maker 2021-07-20 19:53:21 -07:00 committed by Sebastian Ullrich
parent 0943dc31fc
commit c5ffcc5dd6

View file

@ -62,7 +62,7 @@ def contradictionCore (mvarId : MVarId) (useDecide : Bool) (searchDepth : Nat) :
assignExprMVar mvarId (← mkNoConfusion (← getMVarType mvarId) localDecl.toExpr)
return true
-- (h : p) s.t. `decide p` evaluates to `false`
if useDecide && !localDecl.type.hasFVar && !localDecl.type.hasFVar then
if useDecide && !localDecl.type.hasFVar then
try
let d ← mkDecide localDecl.type
let r ← withDefault <| whnf d
@ -74,7 +74,7 @@ def contradictionCore (mvarId : MVarId) (useDecide : Bool) (searchDepth : Nat) :
pure ()
return false
def contradiction (mvarId : MVarId ) (useDecide : Bool := true) (searchDepth : Nat := 2): MetaM Unit :=
def contradiction (mvarId : MVarId) (useDecide : Bool := true) (searchDepth : Nat := 2) : MetaM Unit :=
unless (← contradictionCore mvarId useDecide searchDepth) do
throwTacticEx `contradiction mvarId ""