Skip to content

Commit

Permalink
Add tests for the infinite rewrite sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatolay committed Dec 7, 2024
1 parent d0f8f03 commit c33e4ce
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Minimal/Examples.lean
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,38 @@ def test5 : example5 ⇝* example5_res :=
test5_red
ReflTransGen.refl

---------------------------------
-- TEST 6: infinite reduction sequence presented after Definition 3.1 [KS22]
-- ⟦ x ↦ ρ⁰.y, y ↦ ρ⁰.x ⟧.x ⇝ ⟦ x ↦ ρ⁰.y, y ↦ ρ⁰.x ⟧.y
-- ⟦ x ↦ ρ⁰.y, y ↦ ρ⁰.x ⟧.y ⇝ ⟦ x ↦ ρ⁰.y, y ↦ ρ⁰.x ⟧.x

def example6_bindings : Bindings ["x", "y"] :=
.cons "x" (by simp) (attached (dot (loc 0) "y"))
(.cons "y" (by simp) (attached (dot (loc 0) "x")) .nil)

def example6_obj : Term := obj example6_bindings

def test6_1 : (dot example6_obj "x" ⇝ dot example6_obj "y") := by
have reduction :=
dot_c
(dot (loc 0) "y")
"x"
example6_bindings
rfl
(by simp [lookup])
simp [substitute] at reduction
exact reduction

def test6_2 : (dot example6_obj "y" ⇝ dot example6_obj "x") := by
have reduction :=
dot_c
(dot (loc 0) "x")
"y"
example6_bindings
rfl
(by simp [lookup])
simp [substitute] at reduction
exact reduction

---------------------------------
-- Examples/tests of different term reductions presented after Definition 3.1 [KS22]
Expand Down

0 comments on commit c33e4ce

Please sign in to comment.