Skip to content

Commit

Permalink
revCDeriv discharger recognized fpropParam
Browse files Browse the repository at this point in the history
  • Loading branch information
lecopivo committed Jan 3, 2024
1 parent 3a2e925 commit 0b20f6d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions SciLean/Core/FunctionTransformations/RevCDeriv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ by

open Lean Meta Qq in
def discharger (e : Expr) : SimpM (Option Expr) := do
withTraceNode `revCDeriv_discharger (fun _ => return s!"discharge {← ppExpr e}") do
withTraceNode `revDeriv_discharger (fun _ => return s!"discharge {← ppExpr e}") do
let cache := (← get).cache
let config : FProp.Config := {}
let state : FProp.State := { cache := cache }
Expand All @@ -649,10 +649,14 @@ def discharger (e : Expr) : SimpM (Option Expr) := do
if proof?.isSome then
return proof?
else
-- if `fprop` fails try assumption
let tac := FTrans.tacticToDischarge (Syntax.mkLit ``Lean.Parser.Tactic.assumption "assumption")
let proof? ← tac e
return proof?
if let .some prf ← Lean.Meta.findLocalDeclWithType? e then
return .some (.fvar prf)
else
if e.isAppOf ``fpropParam then
trace[Meta.Tactic.fprop.unsafe] s!"discharging with sorry: {← ppExpr e}"
return .some <| ← mkAppOptM ``sorryProofAxiom #[e.appArg!]
else
return none


open Lean Meta FTrans in
Expand Down

0 comments on commit 0b20f6d

Please sign in to comment.