Commit 522ffa72 authored by Gaspard FEREY's avatar Gaspard FEREY

Added maude files to check model confluence.

parent b85b7cb2
......@@ -37,7 +37,7 @@ u : i : Sort -> U (plus i 1).
lift : i : Sort -> a : U i -> U (plus i 1).
def llift : i : Sort -> a : U 0 -> U i.
def liftn : i : Sort -> a : U 0 -> U i.
def prod :
i : Sort ->
......@@ -48,13 +48,13 @@ def prod :
(; Rewriting rules ;)
[a] llift 0 a --> a
[i,a] llift (plus i 1) a --> lift i (llift i a).
[a] liftn 0 a --> a
[i,a] liftn (plus i 1) a --> lift i (liftn i a).
[i] T (plus i 1) (u i) --> U i
[i,a] T (plus i 1) (lift i a) --> T i a
[i,a] T i (llift i a) --> T 0 a
[i,a] T i (liftn i a) --> T 0 a
[i,a,b] T 0 (prod i 0 a b) --> x : T i a -> T 0 (b x)
......@@ -86,7 +86,7 @@ def prod :
--> lift 0 (prod 0 0 a (x => b x))
[i,a,b] prod (plus i 1) 1 a (x => lift 0 (b x))
--> llift (plus i 1) (prod (plus i 1) 0 a (x => b x))
--> liftn (plus i 1) (prod (plus i 1) 0 a (x => b x))
[i,a,b] prod (plus i 1) 0 (lift i a) b
--> prod i 0 a b.
fmod LPM is
sort Nat .
sort Term .
sort Type .
op 0 : -> Nat [ctor] .
op 1 : -> Nat [ctor] .
op _+_ : Nat Nat -> Nat [comm assoc id: 0 ctor] .
op max : Nat Nat -> Nat .
op rule : Nat Nat -> Nat .
op U : Nat -> Type .
op T : Nat Term -> Type .
op u : Nat -> Term .
op lift : Nat Term -> Term .
op liftn : Nat Term -> Term .
op prod : Nat Nat Term Term -> Term .
op Pi : Type Type -> Type .
vars i j l m x : Nat .
vars a b : Term .
eq max(i, i + j) = i + j .
eq max(i + j, j) = i + j .
eq rule(i, 0) = 0 .
eq rule(i, j + 1) = max(i, j + 1) .
eq rule(i, i + j) = i + j .
eq liftn(0, a) = a .
eq liftn(i + 1, a) = lift(i, liftn(i, a)) .
eq T(i + 1, u(i)) = U(i) .
eq T(i + 1, lift(i, a)) = T(i, a) .
eq T(i, liftn(i, a)) = T(0, a) .
eq T(0, prod(i, 0, a, b)) = Pi(T(i, a), T(0, b)) .
eq T(i + j, prod(i, i + j, a, b)) = Pi(T(i, a), T(i + j, b)) .
eq T(i + j + 1, prod(i + j + 1, j + 1, a, b)) = Pi(T(i + j + 1, a), T(j + 1, b)) .
eq prod(i + 1, i + j + 1, lift(i, a), b) = prod(i, i + j + 1, a, b) .
eq prod(i + j + 1 + 1, j + 1, lift(i + j + 1, a), b) = lift(i + j + 1, prod(i + j + 1, j + 1, a, b)) .
eq prod(i + j + 1 + 1, j + 1 + 1, a, lift(j + 1, b)) = prod(i + j + 1 + 1, j + 1, a, b) .
eq prod(i, i + j + 1, a, lift(i + j, b)) = lift(i + j, prod(i, i + j, a, b)) .
eq prod(i + 1, 1, a, lift(0, b)) = liftn(i + 1, prod(i + 1, 0, a, b)) .
eq prod(0, 1, a, lift(0, b)) = lift(0, prod(0, 0, a, b)) .
eq prod(i + 1, 0, lift(i, a), b) = prod(i, 0, a, b) .
endfm
......@@ -46,7 +46,7 @@ u : i : Sort -> U (plus i 1).
lift : i : Sort -> a : U i -> U (plus i 1).
def llift : i : Sort -> a : U 0 -> U i.
def liftn : i : Sort -> a : U 0 -> U i.
def prod :
i : Sort ->
......@@ -57,16 +57,16 @@ def prod :
(; Rewriting rules ;)
[ a] llift 0 a --> a
[i,a] llift (plus i 1) a --> lift i (llift i a)
[ a] llift 1 a --> lift 0 a. (; Derived from previous ;)
[ a] liftn 0 a --> a
[i,a] liftn (plus i 1) a --> lift i (liftn i a)
[ a] liftn 1 a --> lift 0 a. (; Derived from previous ;)
[i ] T (plus i 1) (u i) --> U i
[ ] T 1 (u 0) --> U 0 (; Derived from previous ;)
[i,a] T (plus i 1) (lift i a) --> T i a
[ a] T 1 (lift 0 a) --> T 0 a (; Derived from previous ;)
[i,a] T i (llift i a) --> T 0 a
[i,a] T i (liftn i a) --> T 0 a
[i,a,b] T 0 (prod i 0 a b) --> x : T i a -> T 0 (b x)
......@@ -135,14 +135,13 @@ def prod :
--> lift 0 (prod 0 0 a (x => b x))
[i,a,b] prod (plus i 1) 1 a (x => lift 0 (b x))
--> llift (plus i 1) (prod (plus i 1) 0 a (x => b x))
--> liftn (plus i 1) (prod (plus i 1) 0 a (x => b x))
(; Derived from previous ;)
[a,b] prod 1 1 a (x => lift 0 (b x))
--> llift 1 (prod 1 0 a (x => b x))
--> liftn 1 (prod 1 0 a (x => b x))
[i,a,b] prod (plus i 1) 0 (lift i a) b
--> prod i 0 a b
(; Derived from previous ;)
[a,b] prod 1 0 (lift 0 a) b
--> prod 0 0 a b.
fmod LPM is
sort Nat .
sort Term .
sort Type .
op 0 : -> Nat [ctor] .
op 1 : -> Nat [ctor] .
op _+_ : Nat Nat -> Nat [comm assoc] .
op max : Nat Nat -> Nat .
op rule : Nat Nat -> Nat .
op U : Nat -> Type .
op T : Nat Term -> Type .
op u : Nat -> Term .
op lift : Nat Term -> Term .
op liftn : Nat Term -> Term .
op prod : Nat Nat Term Term -> Term .
op Pi : Type Type -> Type .
vars i j l m x : Nat .
vars a b : Term .
eq i + 0 = i .
eq max(i, i + j) = i + j .
eq max(i + j, j) = i + j .
eq max(i, i) = i .
eq max(i, 0) = i .
eq max(0, i) = i .
eq rule(i, 0) = 0 .
eq rule(i, j + 1) = max(i, j + 1) .
eq rule(i, 1) = max(i, 1) .
eq rule(i, i + j) = i + j .
eq rule(0, j) = j .
eq rule(i, i) = i .
eq liftn(0, a) = a .
eq liftn(i + 1, a) = lift(i, liftn(i, a)) .
eq liftn(1 , a) = lift(0, a) .
eq T(i + 1, u(i)) = U(i) .
eq T(1 , u(0)) = U(0) .
eq T(i + 1, lift(i, a)) = T(i, a) .
eq T(1 , lift(0, a)) = T(0, a) .
eq T(i, liftn(i, a)) = T(0, a) .
eq T(0, prod(i, 0, a, b)) = Pi(T(i, a), T(0, b)) .
eq T(i + j, prod(i, i + j, a, b)) = Pi(T(i, a), T(i + j, b)) .
eq T(j , prod(0, j , a, b)) = Pi(T(0, a), T(j , b)) .
eq T(i , prod(i, i , a, b)) = Pi(T(i, a), T(i , b)) .
eq T(i + j + 1, prod(i + j + 1, j + 1, a, b)) = Pi(T(i + j + 1, a), T(j + 1, b)) .
eq T(j + 1 , prod(j + 1 , j + 1, a, b)) = Pi(T(j + 1, a) , T(j + 1, b)) .
eq T(i + 1 , prod(i + 1 , 1 , a, b)) = Pi(T(i + 1, a) , T(1 , b)) .
eq prod(i + 1, i + j + 1, lift(i, a), b) = prod(i, i + j + 1, a, b) .
eq prod( 1, j + 1, lift(0, a), b) = prod(0, j + 1, a, b) .
eq prod(i + 1, i + 1, lift(i, a), b) = prod(i, i + 1, a, b) .
eq prod(i + j + 1 + 1, j + 1, lift(i + j + 1, a), b) = lift(i + j + 1, prod(i + j + 1, j + 1, a, b)) .
eq prod( j + 1 + 1, j + 1, lift( j + 1, a), b) = lift( j + 1, prod( j + 1, j + 1, a, b)) .
eq prod(i + 1 + 1, 1, lift(i + 1, a), b) = lift(i + 1, prod(i + 1, 1, a, b)) .
eq prod(i + j + 1 + 1, j + 1 + 1, a, lift(j + 1, b)) = prod(i + j + 1 + 1, j + 1, a, b) .
eq prod( j + 1 + 1, j + 1 + 1, a, lift(j + 1, b)) = prod( j + 1 + 1, j + 1, a, b) .
eq prod(i + 1 + 1, 1 + 1, a, lift( 1, b)) = prod(i + 1 + 1, 1, a, b) .
eq prod(i, i + j + 1, a, lift(i + j, b)) = lift(i + j, prod(i, i + j, a, b)) .
eq prod(0, j + 1, a, lift( j, b)) = lift( j, prod(0, j, a, b)) .
eq prod(i, i + 1, a, lift(i , b)) = lift(i , prod(i, i , a, b)) .
eq prod(0, 1, a, lift(0, b)) = lift(0, prod(0, 0, a, b)) .
eq prod(i + 1, 1, a, lift(0, b)) = liftn(i + 1, prod(i + 1, 0, a, b)) .
eq prod( 1, 1, a, lift(0, b)) = liftn( 1, prod( 1, 0, a, b)) .
eq prod(i + 1, 0, lift(i, a), b) = prod(i, 0, a, b) .
eq prod( 1, 0, lift(0, a), b) = prod(0, 0, a, b) .
endfm
load cicup_v2.maude
load /home/gaspi/maude/MFE/src/mfe.maude
(select tool CRC .)
(ccr LPM .)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment