You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If import Mathlib.Data.List.Basic is uncommented here:
import Mathlib.Util.CompileInductive
--import Mathlib.Data.List.BasicinductiveFormula : Type
| pred_const_ : String → List String → Formula
| pred_var_ : String → List String → Formula
| eq_ : String → String → Formula
| true_ : Formula
| false_ : Formula
| not_ : Formula → Formula
| imp_ : Formula → Formula → Formula
| and_ : Formula → Formula → Formula
| or_ : Formula → Formula → Formula
| iff_ : Formula → Formula → Formula
| forall_ : String → Formula → Formula
| exists_ : String → Formula → Formula
| def_ : String → List String → Formula
deriving Inhabited, DecidableEq
compile_inductive% Formula
open Formula
structureDefinition : Type :=
(name : String)
(args : List String)
(q : Formula)
deriving DecidableEq
abbrev Env : Type := List Definition
defFunction.updateIte
{α β : Type}
[DecidableEq α]
(f : α → β)
(a' : α)
(b : β)
(a : α) :
β :=
if a = a' then b else f a
defFunction.updateListIte
{α β : Type}
[DecidableEq α]
(f : α → β) :
List α → List β → α → β
| x::xs, y::ys => Function.updateIte (Function.updateListIte f xs ys) x y
| _, _ => f
structureInterpretation (D : Type) : Type :=
(nonempty : Nonempty D)
(pred_const_ : String → (List D → Prop))
(pred_var_ : String → (List D → Prop))
defVarAssignment (D : Type) : Type := String → D
defHolds
(D : Type)
(I : Interpretation D)
(V : VarAssignment D) : Env → Formula → Prop
| _, pred_const_ X xs => I.pred_const_ X (xs.map V)
| _, pred_var_ X xs => I.pred_var_ X (xs.map V)
| _, eq_ x y => V x = V y
| _, true_ => True
| _, false_ => False
| E, not_ phi => ¬ Holds D I V E phi
| E, imp_ phi psi =>
Holds D I V E phi → Holds D I V E psi
| E, and_ phi psi =>
Holds D I V E phi ∧ Holds D I V E psi
| E, or_ phi psi =>
Holds D I V E phi ∨ Holds D I V E psi
| E, iff_ phi psi =>
Holds D I V E phi ↔ Holds D I V E psi
| E, forall_ x phi =>
∀ d : D, Holds D I (Function.updateIte V x d) E phi
| E, exists_ x phi =>
∃ d : D, Holds D I (Function.updateIte V x d) E phi
| ([] : Env), def_ _ _ => False
| d :: E, def_ name args =>
if name = d.name ∧ args.length = d.args.length
then Holds D I (Function.updateListIte V d.args (List.map V args)) E d.q
else Holds D I V E (def_ name args)
termination_by _ E phi => (E, phi)
then this is reported at the E, imp_ phi psi case in the definition of Holds:
failed to prove termination, possible solutions:
- Use `have`-expressions to prove the remaining goals
- Use `termination_by` to specify a different well-founded relation
- Use `decreasing_by` to specify your own tactic for discharging this kind of goal
case h
D: Type
V: VarAssignment D
E: Env
phipsi: Formula
x✝: (y : (_ : VarAssignment D) ×' (_ : Env) ×' Formula) →
(invImage (fun a => PSigma.casesOn a fun V snd => PSigma.casesOn snd fun E snd => (E, snd))
Prod.instWellFoundedRelationProd).1
y { fst := V, snd := { fst := E, snd := imp_ phi psi } } →
Prop
a✝: x✝ { fst := V, snd := { fst := E, snd := phi } }
(_ :
(invImage (fun a => PSigma.casesOn a fun V snd => PSigma.casesOn snd fun E snd => (E, snd))
Prod.instWellFoundedRelationProd).1
{ fst := V, snd := { fst := E, snd := phi } } { fst := V, snd := { fst := E, snd := imp_ phi psi } })
⊢ sizeOf psi < sizeOf (imp_ phi psi)
The issue seems to be Nat.linearOrderedCommSemiring in Data.Nat.Order.Basic which doesn't interact well with the default decreasing_tactic implementation (in Lean.Init.WFTactics). I haven't figured out the proper fix yet.
If
import Mathlib.Data.List.Basic
is uncommented here:then this is reported at the
E, imp_ phi psi
case in the definition ofHolds
:Zulip discussion that led to finding this: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/feature.20request.3A.20proving.20termination
The text was updated successfully, but these errors were encountered: