Skip to content

Commit

Permalink
Start working on higher-order examples for Diverge
Browse files Browse the repository at this point in the history
  • Loading branch information
sonmarcho committed Dec 11, 2023
1 parent ee669c4 commit 78367ef
Show file tree
Hide file tree
Showing 4 changed files with 355 additions and 218 deletions.
3 changes: 3 additions & 0 deletions backends/lean/Base/Diverge/Base.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Mathlib.Tactic.RunCmd
import Mathlib.Tactic.Linarith
import Base.Primitives.Base
import Base.Arith.Base
import Base.Diverge.ElabBase

/- TODO: this is very useful, but is there more? -/
set_option profiler true
Expand Down Expand Up @@ -1467,6 +1468,7 @@ namespace Ex8
.ret (hd :: tl)

/- The validity theorem for `map`, generic in `f` -/
@[divspec]
theorem map_is_valid
(i : id) (t : ty i)
{{f : (a i t → Result (b i t)) → (a i t) → Result c}}
Expand All @@ -1479,6 +1481,7 @@ namespace Ex8
intros
apply is_valid_p_bind <;> try simp_all

@[divspec]
theorem map_is_valid'
(i : id) (t : ty i)
(k : ((i:id) → (t:ty i) → a i t → Result (b i t)) → (i:id) → (t:ty i) → a i t → Result (b i t))
Expand Down
Loading

0 comments on commit 78367ef

Please sign in to comment.