Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Lean v4.10.0 #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lake-manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{"version": 7,
{"version": "1.1.0",
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/leanprover/std4",
[{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"rev": "ae9ae7f279421e45a9b87d67f2d28aaef299de5c",
"name": "std",
"scope": "",
"rev": "0f3e143dffdc3a591662f3401ce1d7a3405227c0",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "v4.10.0",
"inherited": false,
"configFile": "lakefile.lean"},
{"url": "https://github.com/gebner/quote4",
"type": "git",
"subDir": null,
"rev": "fd760831487e6835944e7eeed505522c9dd47563",
"scope": "",
"rev": "71f54425e6fe0fa75f3aef33a2813a7898392222",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
Expand Down
4 changes: 2 additions & 2 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ open Lake DSL
package iris where
srcDir := "./src/"

require std from git "https://github.com/leanprover/std4" @ "main"
require batteries from git "https://github.com/leanprover-community/batteries" @ "v4.10.0"
require Qq from git "https://github.com/gebner/quote4" @ "master"

@[default_target]
lean_lib iris
lean_lib Iris
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.6.0-rc1
leanprover/lean4:v4.10.0
2 changes: 1 addition & 1 deletion src/Iris/Algebra/OFE.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright (c) 2023 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Std.Logic
import Batteries.Logic

namespace Iris

Expand Down
2 changes: 1 addition & 1 deletion src/Iris/BI/DerivedLaws.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright (c) 2022 Lars König. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Lars König, Mario Carneiro
-/
import Std.Logic
import Batteries.Logic
import Iris.BI.Classes
import Iris.BI.Extensions
import Iris.BI.BI
Expand Down
5 changes: 4 additions & 1 deletion src/Iris/BI/Notation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ partial def unpackIprop [Monad m] [MonadRef m] [MonadQuotation m] : Term → m T
| `(?$P:ident) => do `(?$P)
| `(($P)) => do `(($(← unpackIprop P)))
| `($P $[ $Q]*) => do ``($P $[ $Q]*)
| `(if $c then $t else $e) => do `(if $c then $(← unpackIprop t) else $(← unpackIprop e))
| `(if $c then $t else $e) => do
let t ← unpackIprop t
let e ← unpackIprop e
`(if $c then $t else $e)
| `(($P : $t)) => do ``(($(← unpackIprop P) : $t))
| `($t) => `($t:term)

Expand Down
1 change: 0 additions & 1 deletion src/Iris/Instances/Classical/Instance.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Copyright (c) 2022 Lars König. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Lars König
-/
import Std.Tactic.RCases
import Iris.BI
import Iris.Instances.Data
import Iris.Std.Equivalence
Expand Down
1 change: 0 additions & 1 deletion src/Iris/Instances/Data/SetNotation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Copyright (c) 2022 Lars König. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Lars König
-/
import Std.Classes.SetNotation

namespace Iris.Instances.Data

Expand Down
4 changes: 2 additions & 2 deletions src/Iris/ProofMode/Instances.lean
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ instance fromPure_pure_sep_true (a1 a2 : Bool) (φ1 φ2 : Prop) [BI PROP] (P1 P2
| true, false => persistent_and_affinely_sep_l.1
| true, true => affinely_and.1.trans persistent_and_sep_1

instance fromPure_pure_wand_true (a : Bool) (φ1 φ2 : Prop) [BI PROP] (P1 P2 : PROP)
instance fromPure_pure_wand_true (φ1 φ2 : Prop) [BI PROP] (P1 P2 : PROP)
[h1 : IntoPure P1 φ1] [h2 : FromPure true P2 φ2] [Affine P1] :
FromPure true iprop(P1 -∗ P2) (φ1 → φ2) where
from_pure := by
Expand All @@ -520,7 +520,7 @@ instance fromPure_pure_wand_true (a : Bool) (φ1 φ2 : Prop) [BI PROP] (P1 P2 :
(and_mono_r (affine_affinely P1).2).trans <|
affinely_and_r.1.trans <| affinely_mono <| (and_mono pure_imp_2 h1.1).trans imp_elim_l

instance fromPure_pure_wand_false (a : Bool) (φ1 φ2 : Prop) [BI PROP] (P1 P2 : PROP)
instance fromPure_pure_wand_false (φ1 φ2 : Prop) [BI PROP] (P1 P2 : PROP)
[h1 : IntoPure P1 φ1] [h2 : FromPure false P2 φ2] :
FromPure false iprop(P1 -∗ P2) (φ1 → φ2) where
from_pure := by
Expand Down
2 changes: 1 addition & 1 deletion src/Iris/ProofMode/Tactics/Clear.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def clearCore {prop : Q(Type)} (_bi : Q(BI $prop)) (e e' out goal : Q($prop))
if out.isAppOfArity ``intuitionistically 3 then
have out' : Q($prop) := out.appArg!
have : $out =Q iprop(□ $out') := ⟨⟩
pure q(clear_intuitionistic $pf)
pure q(clear_intuitionistic (Q := $goal) $pf)
else
let _ ← synthInstanceQ q(TCOr (Affine $out) (Absorbing $goal))
pure q(clear_spatial $pf)
Expand Down
2 changes: 1 addition & 1 deletion src/Iris/ProofMode/Tactics/Pure.lean
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ elab "ipure_intro" : tactic => do
let (mvar, { e, goal, .. }) ← istart (← getMainGoal)
mvar.withContext do

let b ← mkFreshExprMVarQ q(Bool)
let b : Q(Bool) ← mkFreshExprMVarQ q(Bool)
let φ : Q(Prop) ← mkFreshExprMVarQ q(Prop)
let _ ← synthInstanceQ q(FromPure $b $goal $φ)
let m : Q($φ) ← mkFreshExprMVar (← instantiateMVars φ)
Expand Down
4 changes: 2 additions & 2 deletions src/Iris/ProofMode/Tactics/Specialize.lean
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def SpecializeState.process1 :
return { hyps := hyps', b := b2, out := out₂, pf }
else
-- otherwise specialize the universal quantifier
let α ← mkFreshExprMVarQ q(Type)
let Φ ← mkFreshExprMVarQ q($α → $prop)
let α : Q(Type) ← mkFreshExprMVarQ q(Type)
let Φ : Q($α → $prop) ← mkFreshExprMVarQ q($α → $prop)
let _ ← synthInstanceQ q(IntoForall $out $Φ)
let x ← elabTermEnsuringTypeQ (u := .succ .zero) arg α
have out' : Q($prop) := Expr.headBeta q($Φ $x)
Expand Down
6 changes: 3 additions & 3 deletions src/Iris/Std/Expr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def modifyAppOptM (e : Expr) (args : Array <| Option Expr) : Expr :=

/-- Get the `mdata` entry with the key `"name"`, if available. -/
def getMDataName? : Expr → Option Name
| Expr.mdata md _ => md.get? "name"
| Expr.mdata md _ => md.get? `name
| _ => none

/-- Set the `mdata` entry of `e` with the key `"name"` to `name`. -/
def setMDataName? (e : Expr) (name : Name) : Expr := match e with
| Expr.mdata md e =>
mkMData (md.insert "name" name) e
mkMData (md.insert `name name) e
| e =>
mkMData (KVMap.empty.insert "name" name) e
mkMData (KVMap.empty.insert `name name) e

end Lean.Expr
2 changes: 1 addition & 1 deletion src/Iris/Tests/Tactics.lean
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ theorem disjunction [BI PROP] (Q : PROP) : Q ⊢ <affine> (P1 ∨ P2 ∨ P3) -
theorem conjunction_and_disjunction [BIAffine PROP] (Q : PROP) :
(P11 ∨ P12 ∨ P13) ∗ P2 ∗ (P31 ∨ P32 ∨ P33) ∗ Q ⊢ Q := by
iintro HP
icases HP with ⟨_HP11 | _HP12 | _HP13, HP2, HP31 | HP32 | HP33, HQ⟩
icases HP with ⟨_HP11 | _HP12 | _HP13, _HP2, _HP31 | _HP32 | _HP33, HQ⟩
<;> iexact HQ

theorem move_to_pure [BI PROP] (Q : PROP) : ⊢ <affine> ⌜⊢ Q⌝ -∗ Q := by
Expand Down