Commit 942fa2d2 authored by Gaspard FEREY's avatar Gaspard FEREY

Working on cic.dk

parent 6a633482
#NAME cc.
(; Original system as designed by ASSAF, DOWEK, JOUANNAUD and LIU ;)
(; Original system as designed by ASSAF, DOWEK, JOUANNAUD and LIU.
Maude joins all critical pairs.
Potential issues are:
- No implementation of lifting k levels from universe i.
Can only lift k levels (where k *closed* Sort) from 0 or 1 level from 0.
- 1 + max(i,j) is not convertible with max(1+i, 1+j)
It remains unclear whether this is an issue or not.
;)
(;-------------------------------;)
(; Arithmetic on universes sorts ;)
......
......@@ -5,7 +5,7 @@ fmod LPM is
op 0 : -> Nat [ctor] .
op 1 : -> Nat [ctor] .
op _+_ : Nat Nat -> Nat [comm assoc id: 0 ctor] .
op _+_ : Nat Nat -> Nat [comm assoc id: 0] .
op max : Nat Nat -> Nat .
op rule : Nat Nat -> Nat .
......@@ -20,7 +20,7 @@ fmod LPM is
op Pi : Type Type -> Type .
vars i j l m x : Nat .
vars i j k l m x : Nat .
vars a b : Term .
......@@ -31,7 +31,6 @@ fmod LPM is
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)) .
......
#NAME cc.
(; System derived from original.
Maude joins all critical pairs.
This variant implements :
- Use of AC+ 0-elimination (instead of ACU)
Potential issues are:
- No implementation of lifting k levels from universe i.
Can only lift k levels (where k *closed* Sort) from 0 or 1 level from 0.
- 1 + max(i,j) is not convertible with max(1+i, 1+j)
It remains unclear whether this is an issue or not.
;)
(;-------------------------------;)
......
#NAME cc.
(; System derived from original.
Maude requires 23 critical pairs to be joined.
rule(i,k) <-> max(k,rule(i,k))
j + max(a,b) <-> max(b,j + max(a,b))
...
This variant implements :
- Use of AC+ 0-elimination (instead of ACU)
- Added the i + (max j k) --> max (i+j) (i+k)
Potential issues are:
- No implementation of lifting k levels from universe i.
Can only lift k levels (where k *closed* Sort) from 0 or 1 level from 0.
;)
(;-------------------------------;)
......
#NAME cc.
(; System derived from original.
No Maude test performed.
This variant implements :
- Use of ACU for max (not for plus)
Potential issues are:
- No implementation of lifting k levels from universe i.
Can only lift k levels (where k *closed* Sort) from 0 or 1 level from 0.
;)
(;-------------------------------;)
......
load cicup_v2.maude
load cicup_0elim_maxplus.maude
load /home/gaspi/maude/MFE/src/mfe.maude
(select tool CRC .)
(ccr LPM .)
(show cps .)
(show all cps .)
......@@ -18,6 +18,12 @@ Polymorphic Definition p_pid_id_expl := @pid (forall A:Type,A->A) (@id).
Polymorphic Definition p_pid_pid := pid (@pid).
Polymorphic Definition p_pid_pid_expl := @pid (forall A:Type,A->A) (@pid).
Print Universes.
Print Sorted Universes.
Universe i j.
Definition aux : forall A : Type@{i}, A -> A :=
p_pid_pid@{j i}.
About p_pid_pid.
......@@ -57,10 +57,13 @@ def prod : s1 : Sort -> s2 : Sort -> a : Univ s1 -> b : (Term s1 a -> Univ s2) -
(; Canonicity rules ;)
[s : Sort] max s s --> s.
[s1 : Sort, s2 : Sort, s3 : Sort] max (max s1 s2) s3 --> max s1 (max s2 s3).
[s1 : Sort, s2 : Sort, s3 : Sort] rule (max s1 s3) s2 --> max (rule s1 s2) (rule s3 s2).
[s1 : Sort, s2 : Sort, s3 : Sort] rule s1 (max s2 s3) --> max (rule s1 s2) (rule s1 s3).
[s : Sort, a : Univ s] lift s s a --> a.
[s1 : Sort, s2 : Sort, s3 : Sort, a : Univ s1]
lift _ s3 (lift s1 s2 a) -->
......
#NAME cic.
(; Natural numbers ;)
Nat : Type.
z : Nat.
s : Nat -> Nat.
defac m [Nat].
[i ] m i z --> i.
[i,j] m (s i) (s j) --> s (m i j).
[i,j,k] m (m (s i) (s j)) k --> m (s (m i j)) k.
(; Sorts ;)
Sort : Type.
prop : Sort.
type : Nat -> Sort.
(; Universe successors ;)
def succ : Sort -> Sort.
[ ] succ prop --> type z.
[i] succ (type i) --> type (s i).
(; Universe product rules ;)
def rule : Sort -> Sort -> Sort.
[s] rule s prop --> prop.
[s] rule prop s --> s.
[i,j] rule (type i) (type j) --> type (m i j).
defac max [Sort].
[s] max s prop --> s.
[s] max prop s --> s.
[i,j] max (type i) (type j) --> type (m i j).
(; Types and terms ;)
Univ : s : Sort -> Type.
def Term : s : Sort -> a : Univ s -> Type.
univ : s : Sort -> Univ (succ s).
def lift : s1 : Sort -> s2 : Sort -> a : Univ s1 -> Univ (max s1 s2).
def prod : s1 : Sort -> s2 : Sort -> a : Univ s1 -> b : (Term s1 a -> Univ s2) -> Univ (rule s1 s2).
[s ] Term _ (univ s) --> Univ s.
[s1,s2,a ] Term _ (lift s1 s2 a) --> Term s1 a.
[s1,s2,a,b] Term _ (prod s1 s2 a b) --> x : Term s1 a -> Term s2 (b x).
(; Canonicity rules ;)
[s : Sort] max s s --> s.
[s1 : Sort, s2 : Sort, s3 : Sort] rule (max s1 s3) s2 --> max (rule s1 s2) (rule s3 s2).
[s1 : Sort, s2 : Sort, s3 : Sort] rule s1 (max s2 s3) --> max (rule s1 s2) (rule s1 s3).
[s : Sort, a : Univ s] lift s s a --> a.
[s1 : Sort, s2 : Sort, s3 : Sort, a : Univ s1]
lift _ s3 (lift s1 s2 a) -->
lift s1 (max s2 s3) a.
[s1 : Sort, s2 : Sort, s3 : Sort, a : Univ s1, b : Term s1 a -> Univ s2]
prod _ s2 (lift s1 s3 a) b -->
lift (rule s1 s2) (rule s3 s2) (prod s1 s2 a b).
[s1 : Sort, s2 : Sort, s3 : Sort, a : Univ s1, b : Term s1 a -> Univ s2]
prod s1 _ a (x => lift s2 s3 (b x)) -->
lift (rule s1 s2) (rule s1 s3) (prod s1 s2 a (x => b x)).
fmod LPM is
sort Nat .
sort Term .
sort Type .
op z : -> Nat [ctor] .
op s : Nat -> Nat [ctor] .
--- op m : Nat Nat -> Nat .
op rule : Nat Nat -> Nat .
op Univ : Nat -> Type .
op Term : Nat Term -> Type .
op univ : Nat -> Term .
op prod : Nat Nat Term Term -> Term .
op lift : Nat Nat Term -> Term .
op Pi : Type Type -> Type .
vars i j k l m x : Nat .
vars p q r t : Nat .
vars a b : Term .
***(
eq m(i, z) = i .
eq m(z, i) = i . --- useless
eq m(i, i) = i .
eq m(s(i),s(j)) = s(m(i, j)) .
--- eq m(s(z),s(j)) = s(j) .
--- eq m(s(i),s(z)) = s(i) .
--- eq m( m(s(i), s(j)), k) = m( s(m(i,j)), k) .
)
eq rule(p, z) = z .
eq rule(z,r) = r .
eq rule(s(i), s(i)) = s(i) .
eq rule(s(i), s(z)) = s(i) .
eq rule(s(i), s(s(j))) = s(rule(i,s(j))) .
***(
eq Term(s(q), univ(q)) = Univ(q) .
eq Term(m(q,r), lift(q,r,a)) = Term(q, a) .
eq Term(rule(q,r), prod(q,r,a,b)) = Pi(Term(q,a),Term(r,b)) .
)
eq Term(p, univ(q)) = Univ(q) .
eq Term(p, prod(q,r,a,b)) = Pi(Term(q,a),Term(r,b)) .
eq Term(rule(q,s(r)), lift(q,r,a)) = Term(q, a) .
eq Term(p, lift(q,r,a)) = Term(q, a) .
***(
eq Term(s(r), lift(z,r,a)) = Term(z, a) .
eq Term(s(q), lift(s(q),z,a)) = Term(s(q), a) .
eq Term(s(rule(q,s(r))), lift(s(q),s(r),a)) = Term(s(q), a) .
eq Term(s(s(q)), lift(s(q),s(z),a)) = Term(s(q), a) .
)
eq lift(s(i),i,a) = a .
--- eq rule(m(p,q),r) = m(rule(p,r),rule(q,r)) .
--- eq rule(p,m(q,r)) = m(rule(p,q),rule(p,r)) .
***(
eq lift(m(r,t),q,lift(r,t,a)) = lift(r,m(q,t),a) .
eq prod(m(r,t),q,lift(r,t,a),b) = lift(rule(r,q),rule(t,q),prod(r,q,a,b)) .
eq prod(p,m(r,t),a,lift(r,t,b)) = lift(rule(p,r),rule(p,t),prod(p,r,a,b)) .
)
--- eq m(r,rule(p,r)) = rule(p,r) .
--- eq lift(r, m(r,t), a) = lift(r,t,a) .
endfm
fmod LPM is
sort Nat .
sort Term .
sort Type .
op z : -> Nat [ctor] .
op _+_ : Nat Nat -> Nat .
op 1 : -> Nat [ctor] .
op m : Nat Nat -> Nat [comm assoc].
op rule : Nat Nat -> Nat .
op Univ : Nat -> Type .
op Term : Nat Term -> Type .
op univ : Nat -> Term .
op lift : Nat Nat Term -> Term .
op prod : Nat Nat Term Term -> Term .
op Pi : Type Type -> Type .
vars i j k l m x : Nat .
vars p q r t : Nat .
vars a b : Term .
eq m(i, z) = i .
eq m(z, i) = i . --- useless
eq m(i, i) = i .
eq 1 + m(i,j) = m(1 + i, 1 + j) .
--- eq m(s(z),s(j)) = s(j) .
--- eq m(s(i),s(z)) = s(i) .
--- eq m( m(s(i), s(j)), k) = m( s(m(i,j)), k) .
eq m(r,rule(p,r)) = rule(p,r) .
eq m(i, i + j) = i + j .
eq i + (j + k) = (i + j) + k .
eq i + z = i .
eq rule(p, z) = z .
eq rule(i, 1 + j) = m(i, 1 + j) .
***(
eq Term(s(q), univ(q)) = Univ(q) .
eq Term(m(q,r), lift(q,r,a)) = Term(q, a) .
eq Term(rule(q,r), prod(q,r,a,b)) = Pi(Term(q,a),Term(r,b)) .
)
eq Term(p, univ(q)) = Univ(q) .
eq Term(p, lift(q,r,a)) = Term(q, a) .
eq Term(p, prod(q,r,a,b)) = Pi(Term(q,a),Term(r,b)) .
eq rule(m(p,q),r) = m(rule(p,r),rule(q,r)) .
eq rule(p,m(q,r)) = m(rule(p,q),rule(p,r)) .
eq lift(p,p,a) = a .
eq lift(p,q,lift(r,t,a)) = lift(r,m(q,t),a) .
***(
eq lift(m(r,t),q,lift(r,t,a)) = lift(r,m(q,t),a) .
eq prod(m(r,t),q,lift(r,t,a),b) = lift(rule(r,q),rule(t,q),prod(r,q,a,b)) .
eq prod(p,m(r,t),a,lift(r,t,b)) = lift(rule(p,r),rule(p,t),prod(p,r,a,b)) .
)
eq prod(p,q,lift(r,t,a),b) = lift(rule(r,q),rule(t,q),prod(r,q,a,b)) .
eq prod(p,q,a,lift(r,t,b)) = lift(rule(p,r),rule(p,t),prod(p,r,a,b)) .
--- eq lift(r, m(r,t), a) = lift(r,t,a) .
endfm
fmod LPM is
sort Nat .
sort Term .
sort Type .
op z : -> Nat [ctor] .
op s : Nat -> Nat [ctor] .
--- op m : Nat Nat -> Nat .
op rule : Nat Nat -> Nat .
op Univ : Nat -> Type .
op Term : Nat Term -> Type .
op univ : Nat -> Term .
op prod : Nat Nat Term Term -> Term .
op lift : Nat Nat Term -> Term .
op Pi : Type Type -> Type .
vars i j k l m x : Nat .
vars p q r t : Nat .
vars a b : Term .
***(
eq m(i, z) = i .
eq m(z, i) = i . --- useless
eq m(i, i) = i .
eq m(s(i),s(j)) = s(m(i, j)) .
--- eq m(s(z),s(j)) = s(j) .
--- eq m(s(i),s(z)) = s(i) .
--- eq m( m(s(i), s(j)), k) = m( s(m(i,j)), k) .
)
eq rule(p, z) = z .
eq rule(z,r) = r .
eq rule(s(i), s(i)) = s(i) .
eq rule(s(i), s(z)) = s(i) .
eq rule(s(i), s(s(j))) = s(rule(i,s(j))) .
***(
eq Term(s(q), univ(q)) = Univ(q) .
eq Term(m(q,r), lift(q,r,a)) = Term(q, a) .
eq Term(rule(q,r), prod(q,r,a,b)) = Pi(Term(q,a),Term(r,b)) .
)
eq Term(p, univ(q)) = Univ(q) .
eq Term(p, prod(q,r,a,b)) = Pi(Term(q,a),Term(r,b)) .
eq Term(rule(q,s(r)), lift(q,r,a)) = Term(q, a) .
--- eq Term(p, lift(q,r,a)) = Term(q, a) .
***(
eq Term(s(r), lift(z,r,a)) = Term(z, a) .
eq Term(s(q), lift(s(q),z,a)) = Term(s(q), a) .
eq Term(s(rule(q,s(r))), lift(s(q),s(r),a)) = Term(s(q), a) .
eq Term(s(s(q)), lift(s(q),s(z),a)) = Term(s(q), a) .
)
eq lift(s(i),i,a) = a .
--- eq rule(m(p,q),r) = m(rule(p,r),rule(q,r)) .
--- eq rule(p,m(q,r)) = m(rule(p,q),rule(p,r)) .
***(
eq lift(m(r,t),q,lift(r,t,a)) = lift(r,m(q,t),a) .
eq prod(m(r,t),q,lift(r,t,a),b) = lift(rule(r,q),rule(t,q),prod(r,q,a,b)) .
eq prod(p,m(r,t),a,lift(r,t,b)) = lift(rule(p,r),rule(p,t),prod(p,r,a,b)) .
)
--- eq m(r,rule(p,r)) = rule(p,r) .
--- eq lift(r, m(r,t), a) = lift(r,t,a) .
endfm
load cic_v2.maude
load /home/gaspi/maude/MFE/src/mfe.maude
(select tool CRC .)
(CRC help .)
(ccr LPM .)
---(show all critical pairs .)
\ No newline at end of file
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