statement
stringlengths
1
693
proof
stringlengths
0
9.09k
type
stringclasses
7 values
symbolic_name
stringlengths
1
30
library
stringclasses
95 values
filename
stringclasses
522 values
imports
listlengths
0
0
deps
listlengths
0
25
docstring
stringclasses
1 value
source_url
stringclasses
1 value
commit
stringclasses
1 value
sim_trans : (g:ctx) Sim [g |- P] [g |- Q] -> Sim [g |- Q] [g |- R] -> Sim [g |- P] [g |- R]
= fun s1 s2 .Simf t => let MakeTransSimf t1 s3 = s1 .Simf t in let MakeTransSimf t2 s4 = s2 .Simf t1 in MakeTransSimf t2 (sim_trans s3 s4) | s1 s2 .SimDn t => let MakeTransSimDn t1 s3 = s1 .SimDn t in let MakeTransSimDn t2 s4 = s2 .SimDn t1 in MakeTransSimDn t2 (mlam W => sim_trans (s3 [ |- W]...
rec
sim_trans
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/bisimulation.bel
[]
[ "Sim", "ctx", "s2", "t1", "t2" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Bisim : (g:ctx) [g |- p] -> [g |- p] -> ctype
= | Leftf : Bisim [g |- P] [g |- Q] :: [g |- one P A[] P'] -> ExistsTransBisimf [g |- P'] [g |- Q] [ |- A] | LeftDn : Bisim [g |- P] [g |- Q] :: [g |- oneb P (dn X[]) (\x. M)] -> ExistsTransBisimDn [g, x:n |- M] [g |- Q] [ |- X] | LeftUp : Bisim [g |- P] [g |- Q] :: [g |- oneb P (up X[]) ...
coinductive
Bisim
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/bisimulation.bel
[]
[ "ExistsTransBisimDn", "ExistsTransBisimUp", "ExistsTransBisimf", "ctx", "one", "oneb" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ExistsTransBisimf : (g : ctx) [g |- p] -> [g |- p] -> [ |- a] -> ctype
= | MakeTransOne : [g |- one Q A[] Q'] -> Bisim [g |- P'] [g |- Q'] -> ExistsTransBisimf [g |- P'] [g |- Q] [ |- A]
inductive
ExistsTransBisimf
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/bisimulation.bel
[]
[ "Bisim", "ctx", "one" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ExistsTransBisimDn : (g : ctx) [g, x:n |- p] -> [g |- p] -> [ |- n] -> ctype
= | MakeTransOneDn : [g |- oneb Q (dn X[]) \x.N] -> ({W : [ |- n]} Bisim [g |- M[.., W[]]] [g |- N[.., W[]]]) -> ExistsTransBisimDn [g, x:n |- M] [g |- Q] [ |- X]
inductive
ExistsTransBisimDn
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/bisimulation.bel
[]
[ "Bisim", "ctx", "oneb" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ExistsTransBisimUp : (g : ctx) [g, x:n |- p] -> [g |- p] -> [ |- n] -> ctype
= | MakeTransOneUp : [g |- oneb Q (up X[]) \x.N] -> ({W : [ |- n]} Bisim [g |- M[.., W[]]] [g |- N[.., W[]]]) -> ExistsTransBisimUp [g, x:n |- M] [g |- Q] [ |- X]
inductive
ExistsTransBisimUp
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/bisimulation.bel
[]
[ "Bisim", "ctx", "oneb" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
bisim_refl : (g:ctx) {P:[g|- p]} Bisim [g |- P] [g |- P]
= fun [g |- P] .Leftf (t : [g |- one P A[] P']) => MakeTransOne t (bisim_refl [g |- P']) | [g |- P] .LeftDn (t : [g |- oneb P (dn X[]) (\x. M)]) => MakeTransOneDn t (mlam W => bisim_refl [g |- M[.., W[]]]) | [g |- P] .LeftUp (t : [g |- oneb P (up X[]) (\x. M)]) => MakeTransOneUp t (mlam W => bisim_refl ...
rec
bisim_refl
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/bisimulation.bel
[]
[ "Bisim", "ctx", "one", "oneb" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
bisim_trans : (g:ctx) Bisim [g |- P] [g |- Q] -> Bisim [g |- Q] [g |- R] -> Bisim [g |- P] [g |- R]
= fun s1 s2 .Leftf t => let MakeTransOne t1 s3 = s1 .Leftf t in let MakeTransOne t2 s4 = s2 .Leftf t1 in MakeTransOne t2 (bisim_trans s3 s4) | s1 s2 .LeftDn t => let MakeTransOneDn t1 s3 = s1 .LeftDn t in let MakeTransOneDn t2 s4 = s2 .LeftDn t1 in MakeTransOneDn t2 (mlam W => bisim_trans (s3 ...
rec
bisim_trans
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/bisimulation.bel
[]
[ "Bisim", "ctx", "s2", "t1", "t2" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
bisim_sym : (g:ctx) Bisim [g |- P] [g |- Q] -> Bisim [g |- Q] [g |- P]
= fun s .Leftf t => s .Rightf t | s .LeftDn t => s .RightDn t | s .LeftUp t => s .RightUp t | s .Rightf t => s .Leftf t | s .RightDn t => s .LeftDn t | s .RightUp t => s .LeftUp t
rec
bisim_sym
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/bisimulation.bel
[]
[ "Bisim", "ctx" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Pt : (g:ctx) [g |- p] -> ctype
= | Pproc : Pt [ |- bang (nu (\z.par (out z b null) (inp z (\y. out x y null))))]
inductive
Pt
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "ctx" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Qt : (g:ctx) [g |- p] -> ctype
= | Qproc : Qt [ |- bang (taup (out x b null))]
inductive
Qt
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "ctx" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Inv : (g:ctx) [g |- p] -> [g |- p] -> ctype
= | Inv_pq : Pt [g |- P] -> Qt [g |- Q] -> Inv [g |- P] [g |- Q] | Inv_qp : Qt [g |- Q] -> Pt [g |- P] -> Inv [g |- Q] [g |- P] | Inv_nupar : Inv [g |- M] [g |- N] -> Inv [g |- par (nu (\z. par null null)) M] [g |- par null N] | Inv_parnu : Inv [g |- N] [g |- M] -> Inv [g |- par null N] [g |- par (nu (\...
inductive
Inv
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "Pt", "Qt", "ctx" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ExistsTransInvf : (g : ctx) [g |- p] -> [g |- p] -> [ |- a] -> ctype
= | MakeTransInvOne : [g |- one Q A[] Q'] -> Inv [g |- P'] [g |- Q'] -> ExistsTransInvf [g |- P'] [g |- Q] [ |- A]
inductive
ExistsTransInvf
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "Inv", "ctx", "one" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ExistsTransInvDn : (g : ctx) [g, x:n |- p] -> [g |- p] -> [ |- n] -> ctype
= | MakeTransInvOneDn : [g |- oneb Q (dn X[]) (\x.N)] -> ({W : [ |- n]} Inv [g |- M[.., W[]]] [g |- N[.., W[]]]) -> ExistsTransInvDn [g, x:n |- M] [g |- Q] [ |- X]
inductive
ExistsTransInvDn
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "Inv", "ctx", "oneb" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ExistsTransInvUp : (g : ctx) [g, x:n |- p] -> [g |- p] -> [ |- n] -> ctype
= | MakeTransInvOneUp : [g |- oneb Q (up X[]) (\x.N)] -> ({W : [ |- n]} Inv [g |- M[.., W[]]] [g |- N[.., W[]]]) -> ExistsTransInvUp [g, x:n |- M] [g |- Q] [ |- X]
inductive
ExistsTransInvUp
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "Inv", "ctx", "oneb" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
BisimInv : (g:ctx) [g |- p] -> [g |- p] -> ctype
= | BInvLf : BisimInv [g |- P] [g |- Q] :: [g |- one P A[] P'] -> ExistsTransInvf [g |- P'] [g |- Q] [ |- A] | BInvLDn : BisimInv [g |- P] [g |- Q] :: [g |- oneb P (dn X[]) (\x. M)] -> ExistsTransInvDn [g, x:n |- M] [g |- Q] [ |- X] | BInvLUp : BisimInv [g |- P] [g |- Q] :: [g |- oneb P (u...
coinductive
BisimInv
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "ExistsTransInvDn", "ExistsTransInvUp", "ExistsTransInvf", "ctx", "one", "oneb" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
SimInv : (g:ctx) [g |- p] -> [g |- p] -> ctype
= | SInvf : SimInv [g |- P] [g |- Q] :: [g |- one P A[] P'] -> ExistsTransInvf [g |- P'] [g |- Q] [ |- A] | SInvDn : SimInv [g |- P] [g |- Q] :: [g |- oneb P (dn X[]) (\x. M)] -> ExistsTransInvDn [g, x:n |- M] [g |- Q] [ |- X] | SInvUp : SimInv [g |- P] [g |- Q] :: [g |- oneb P (up X[]) (\...
coinductive
SimInv
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "ExistsTransInvDn", "ExistsTransInvUp", "ExistsTransInvf", "ctx", "one", "oneb" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
invsym : (g:ctx) Inv [g |- P] [g |- Q] -> Inv [g |- Q] [g |- P]
= fun (Inv_pq a b) => Inv_qp b a | (Inv_qp a b) => Inv_pq b a | (Inv_nupar a) => let b = invsym a in Inv_parnu b | (Inv_parnu a) => let b = invsym a in Inv_nupar b | (Inv_nuout a) => let b = invsym a in Inv_outnu b | (Inv_outnu a) => let b = invsym a in Inv_nuout b
rec
invsym
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "Inv", "ctx" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
simBisim : (g:ctx) SimInv [g |- P] [g |- Q] -> SimInv [g |- Q] [g |- P] -> BisimInv [g |- P] [g |- Q]
= fun s1 s2 .BInvLf t => s1 .SInvf t | s1 s2 .BInvLDn t => s1 .SInvDn t | s1 s2 .BInvLUp t => s1 .SInvUp t | s1 s2 .BInvRf t => s2 .SInvf t | s1 s2 .BInvRDn t => s2 .SInvDn t | s1 s2 .BInvRUp t => s2 .SInvUp t
rec
simBisim
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/invariant.bel
[]
[ "BisimInv", "SimInv", "ctx", "s2" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
n : type
= | b : n | x : n
LF
n
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/picalc.bel
[]
[]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
a : type
= | tau : a | dn : n -> n -> a | up : n -> n -> a
LF
a
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/picalc.bel
[]
[]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
p : type
= | null : p | bang : p -> p | taup : p -> p | match : n -> n -> p -> p | out : n -> n -> p -> p | plus : p -> p -> p | par : p -> p -> p | nu : (n -> p) -> p | inp : n -> (n -> p) -> p
LF
p
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/picalc.bel
[]
[ "plus" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
eq : p -> p -> type
= | refl : eq X X
LF
eq
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/picalc.bel
[]
[ "refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
one : p -> a -> p -> type
= % free output | outf : one (out X Y P) (up X Y) P % tau | taua : one (taup P) tau P % match prefix | mf : one P A Q -> one (match X X P) A Q | slf : one P A R -> one (plus P Q) A R | srf : one Q A R -> one (plus P Q) A R | prf : one P A P1 -> one (par P Q) A (par P1 Q) | plf : o...
LF
one
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/picalc.bel
[]
[ "eq", "oneb", "plus" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
oneb : p -> (n -> a) -> (n -> p) -> type
= % bound input | inb : oneb (inp X M) (dn X) M | mb : oneb P A M -> oneb (match X X P) A M % sum | slb : oneb P A R -> oneb (plus P Q) A M | srb : oneb Q A R -> oneb (plus P Q) A M % par | plb : oneb P A (\x.M x) -> oneb (par P Q) A (\x. par (M x) Q) | prb : oneb Q A (\x.M x) -> oneb (...
LF
oneb
examples/codatatypes/bisimulation
examples/codatatypes/bisimulation/picalc.bel
[]
[ "one", "plus" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
tp : type
= | top : tp | arr : tp -> tp -> tp | list : tp -> tp
LF
tp
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "list" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
term : tp -> type
= | app : term (arr S T) -> term S -> term T | lam : (term S -> term T) -> term (arr S T) | fix : (term T -> term T) -> term T | unit : term top | nil : term (list T) | cons : term T -> term (list T) -> term (list T) | lcase : term (list S) -> term T -> (term S -> term (list S) -> term T) -> term T
LF
term
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "fix", "list", "tp", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Value : [ |- term T] -> ctype
= | Val_lam : Value [ |- lam \x.N] | Val_unit : Value [ |- unit] | Val_nil : Value [ |- nil] | Val_cons : Value [ |- cons M1 M2]
inductive
Value
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "term", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Eval : [ |- term T] -> [ |- term T] -> ctype
= | Ev_app : Eval [ |- M1] [ |- lam (\x.N)] -> Eval [ |- N[M2]] [ |- V] -> Eval [ |- app M1 M2] [ |- V] | Ev_val : Value [ |- V] -> Eval [ |- V] [ |- V] | Ev_fix : Eval [ |- M[fix \x.M]] [ |- V] -> Eval [ |- fix \x.M] [ |- V] | Ev_case_nil : Eval [ |- M]...
inductive
Eval
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Value", "fix", "list", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Sim : {T:[|- tp]} [|- term T] -> [|- term T] -> ctype
= | Sim_unit : Sim [|- top] [|- M] [|- N] :: Eval [ |- M] [ |- unit] -> Eval [ |- N] [ |- unit] | Sim_nil : Sim [|- list T] [|- M] [|- N] :: Eval [ |- M] [ |- nil] -> Eval [ |- N] [|- nil] | Sim_cons : Sim [|- list T] [|- M] [|- N] :: Eval [ |- M] [ |- cons H L] -> Ex_sim_cons [...
coinductive
Sim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Ex_sim_cons", "Ex_sim_lam", "list", "term", "tp", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Ex_sim_cons : [|- term T] -> [|- term (list T)] -> [|- term (list T)] -> ctype
= | ESim_cons : Eval [ |- N] [|- cons H' L'] -> Sim [|- T] [|- H] [|- H'] -> Sim [|- list T] [|- L] [|- L'] -> Ex_sim_cons [|- H] [|- L] [|- N]
inductive
Ex_sim_cons
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Sim", "list", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Ex_sim_lam : [x:term S |- term T[]] -> [|- term (arr S T)] -> ctype
= | ESim_lam : Eval [ |- N] [|- lam \x.N'] -> ({R:[|- term S]} Sim [|- T] [|- M'[R]] [|- N'[R]]) -> Ex_sim_lam [x:term S |- M'] [|- N]
inductive
Ex_sim_lam
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Sim", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_refl : Sim [|- T] [|- M] [|- M]
= / trust / fun .Sim_unit d => d | .Sim_nil d => d | .Sim_cons d => ESim_cons d sim_refl sim_refl | .Sim_lam d => ESim_lam d (mlam R => sim_refl)
rec
sim_refl
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_trans : Sim [|- T] [|- M] [|- N] -> Sim [|- T] [|- N] [|- R] -> Sim [|- T] [|- M] [|- R]
= / trust / fun s1 s2 .Sim_unit d => s2 .Sim_unit (s1 .Sim_unit d) | s1 s2 .Sim_nil d => s2 .Sim_nil (s1 .Sim_nil d) | s1 s2 .Sim_cons d => let ESim_cons d1 s1' s1'' = s1 .Sim_cons d in let ESim_cons d2 s2' s2'' = s2 .Sim_cons d1 in ESim_cons d2 (sim_trans s1' s2') (sim_trans s1'' s2'') | s1 s2 .Sim_l...
rec
sim_trans
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim", "s2" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ctx
= some [t:tp] term t
schema
ctx
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "term", "tp" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
OSim : (g:ctx) {T:[|- tp]} [g |- term T[]] -> [g |- term T[]] -> ctype
= | OSimC : {g:ctx}({$S:$[ |- g]} Sim [|- T] [|- M[$S]] [|- N[$S]]) -> OSim [|- T] [g |- M] [g |- N]
inductive
OSim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim", "ctx", "term", "tp" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_osim : Sim [|- T] [|- M] [|- N] -> OSim [|- T] [|- M] [|- N]
= / total s (sim_osim t m n s) / fun s => OSimC [] (mlam $S => let $[ |- ^] = $[ |- $S] in s)
rec
sim_osim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "OSim", "Sim" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
osim_refl : (g:ctx) OSim [|- T] [g |- M] [g |- M]
= / total m (osim_refl g t m) / OSimC [_] (mlam $S => sim_refl)
rec
osim_refl
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "OSim", "ctx", "sim_refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
osim_trans : (g:ctx) OSim [|- T] [g |- M] [g |- N] -> OSim [|- T] [g |- N] [g |- R] -> OSim [|- T] [g |- M] [g |- R]
= / total s (osim_trans g t m n s) / fun (OSimC [g] f1) (OSimC [g] f2) => OSimC [g] (mlam $S => sim_trans (f1 $[|- $S]) (f2 $[|- $S]))
rec
osim_trans
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "OSim", "ctx", "f2", "sim_trans" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
osim_cus : (g:ctx) (h:ctx) {$S:$[h |- g]} OSim [|- T] [g |- M] [g |- N] -> OSim [|- T] [h |- M[$S]] [h |- N[$S]]
= / total s (osim_cus p t m n s) / fun $[h |- $S] (OSimC [g] f) => OSimC [h] (mlam $S' => f $[|- $S[$S']])
rec
osim_cus
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "OSim", "ctx" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Howe : (g:ctx) {T:[|- tp]} [g |- term T[]] -> [g |- term T[]] -> ctype
= | Howe_unit : OSim [|- top] [g |- unit] [g |- M] -> Howe [|- top] [g |- unit] [g |- M] | Howe_var : {#p:#[g |- term T[]]} OSim [|- T] [g |- #p] [g |- M] -> Howe [|- T] [g |- #p] [g |- M] | Howe_lam : Howe [|- T] [g, x:term _ |- M] [g, x:term _ |- N] -> OSim [|- arr ...
inductive
Howe
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "OSim", "ctx", "fix", "list", "term", "tp", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_osim_trans : (g:ctx) Howe [|- T] [g |- M] [g |- N] -> OSim [|- T] [g |- N] [g |- R] -> Howe [|- T] [g |- M] [g |- R]
= / total h (howe_osim_trans g t m n h) / fun (Howe_unit s1) s2 => Howe_unit (osim_trans s1 s2) | (Howe_var [g |- #p] s1) s2 => Howe_var [g |- #p] (osim_trans s1 s2) | (Howe_lam h1 s1) s2 => Howe_lam h1 (osim_trans s1 s2) | (Howe_app h1 h2 s1) s2 => Howe_app h1 h2 (osim_trans s1 s2) | (Howe_fix h1 s1) s2 => How...
rec
howe_osim_trans
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "OSim", "ctx", "osim_trans", "s2" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_refl : (g:ctx) {M:[g |- term T[]]} Howe [|- T] [g |- M] [g |- M]
= / total m (howe_refl g t m) / mlam M => case [_ |- M] of | [g |- unit] => Howe_unit osim_refl | [g |- #p] => Howe_var [g |- #p] osim_refl | [g |- lam \x.M] => Howe_lam (howe_refl [g, x:term _ |- M]) osim_refl | [g |- app M N] => Howe_app (howe_refl [g |- M]) (howe_refl [g |- N]) osim_refl | [g |- fix \x.M] ...
rec
howe_refl
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "ctx", "fix", "list", "osim_refl", "term", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
osim_howe : (g:ctx) OSim [|- T] [g |- M] [g |- N] -> Howe [|- T] [g |- M] [g |- N]
= / total s (osim_howe g t m n s) / fun s => howe_osim_trans (howe_refl _) s
rec
osim_howe
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "OSim", "ctx", "howe_osim_trans", "howe_refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_howe : Sim [|- T] [|- M] [|- N] -> Howe [|- T] [|- M] [|- N]
= / total s (sim_howe t m n s) / fun s => osim_howe (sim_osim s)
rec
sim_howe
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "Sim", "osim_howe", "sim_osim" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Howe_subst : {g:ctx} (h:ctx) {$S1 : $[h |- g]} {$S2 : $[h |- g]} ctype
= | HNil : Howe_subst [] $[h |- ^] $[h |- ^] | HCons : Howe_subst [g] $[h |- $S1] $[h |- $S2] -> Howe [|- T] [h |- M] [h |- N] -> Howe_subst [g, x:term T[]] $[h |- $S1, M] $[h |- $S2, N]
inductive
Howe_subst
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "ctx", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_subst_refl : {g:ctx} (h:ctx) {$S:$[h |- g]} Howe_subst [g] $[h |- $S] $[h |- $S]
= / trust / fun [] $[h |- ^] => HNil | [g, x:term _] $[h |- $S', M] => HCons (howe_subst_refl [g] $[h |- $S']) (howe_refl [h |- M])
rec
howe_subst_refl
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe_subst", "ctx", "howe_refl", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_ren : {g:ctx}{h:ctx}{$S: $[h |-# g]} Howe [|- T] [g |- M] [g |- N] -> Howe [|- T] [h |- M[$S]] [h |- N[$S]]
= / total hr (howe_ren g h s t m n hr) / mlam g, h, $S => fn hr => case hr of | Howe_unit s => Howe_unit (osim_cus $[h |- $S] s) | Howe_var [g |- #p] s => let os = osim_cus $[h |- $S] s in howe_osim_trans (howe_refl [h |- #p[$S]]) os | Howe_lam h' s => Howe_lam (howe_ren [g, x:term _] [h, x:term _] $[h, x:t...
rec
howe_ren
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "ctx", "howe_osim_trans", "howe_refl", "osim_cus", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_subst_wkn : (g:ctx) (h:ctx) {S:[|-tp]} Howe_subst [g] $[h |- $S1] $[h |- $S2] -> Howe_subst [g] $[h, x:term S[] |- $S1[..]] $[h, x:term S[] |- $S2[..]]
= / total hr (howe_subst_wkn g h s s1 s2 hr) / mlam S => fn h => case h of | HNil => HNil | HCons hs' h' => HCons (howe_subst_wkn [|- S] hs') (howe_ren [_] [_, x:term S[]] $[_, x:term S[] |- ..] h')
rec
howe_subst_wkn
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe_subst", "ctx", "howe_ren", "s2", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_subst_var : (g:ctx) (h:ctx) Howe [|- T] [g |- #p] [g |- M] -> Howe_subst [g] $[h |- $S1] $[h |- $S2] -> Howe [|- T] [h |- #p[$S1]] [h |- M[$S2]]
= / trust / % / total hs (howe_subst_var g h t p m s1 s2 hr hs) / fn ho => fn hs => let hs_annot : Howe_subst [g] $[h |- $S1] $[h |- $S2] = hs in case hs of | HNil => let Howe_var [⊢ #p] s = ho in impossible [⊢ #p] | HCons hs' h' => case ho of | Howe_var [g, x:term _ |- x] s => ...
rec
howe_subst_var
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "Howe_subst", "ctx", "howe_osim_trans", "howe_refl", "osim_cus", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_subst : (g:ctx) (h:ctx) Howe [|- T] [g |- M] [g |- N] -> Howe_subst [g] $[h |- $S1] $[h |- $S2] -> Howe [|- T] [h |- M[$S1]] [h |- N[$S2]]
= / total hr (howe_subst g h t m n s1 s2 hr) / fn ho => fn hs => let hs : Howe_subst [g] $[h |- $S1] $[h |- $S2] = hs in case ho of | Howe_unit s => howe_osim_trans (howe_refl [h |- _]) (osim_cus $[h |- $S2] s) | Howe_var [g |- #p] s => howe_subst_var ho hs | Howe_lam h' s => Howe_lam (howe_subst h' (...
rec
howe_subst
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "Howe_subst", "ctx", "howe_osim_trans", "howe_refl", "howe_subst_var", "howe_subst_wkn", "osim_cus", "s2", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Howe_abs : [x:term S |- term T[]] -> [|- term (arr S T)] -> ctype
= | Howe_absC : Eval [ |- N] [|- lam \x.N'] -> ({R:[|- term S]} Howe [|- T][|- M' [R]] [|- N' [R]]) -> Howe_abs [x:term S |- M'] [|- N]
inductive
Howe_abs
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Howe", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_ev_abs : Howe [ |- arr S T] [|- lam \x.M'] [|- N] -> Howe_abs [x:term S |- M'] [|- N]
= / total h (howe_ev_abs s t m n h) / fun (Howe_lam h' (OSimC [_] s)) => let ESim_lam d f = (s $[|- ^]) .Sim_lam (Ev_val Val_lam) in Howe_absC d (mlam R => let a = sim_osim (f [|- R]) in let h'' = howe_subst h' (HCons HNil (howe_refl [|- R])) in how...
rec
howe_ev_abs
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "Howe_abs", "howe_osim_trans", "howe_refl", "howe_subst", "sim_osim", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_ev_unit : Howe [ |- top] [ |- unit] [ |- N] -> Eval [ |- N] [ |- unit]
= / total h (howe_ev_unit n h) / fun (Howe_unit (OSimC [_]f)) => (f $[|- ^]) .Sim_unit (Ev_val Val_unit)
rec
howe_ev_unit
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Howe", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_ev_nil : Howe [ |- list T] [ |- nil] [ |- N] -> Eval [ |- N] [|- nil]
= / total h (howe_ev_nil t n h) / fun (Howe_nil (OSimC [_] f)) => (f $[|- ^]) .Sim_nil (Ev_val Val_nil)
rec
howe_ev_nil
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Howe", "list" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Howe_cons' : [|- term T] -> [|- term (list T)] -> [|- term (list T)] -> ctype
= | Howe_consC : Eval [ |- N] [ |- cons H' L'] -> Howe [|- T] [|- H] [|- H'] -> Howe [|- list T] [|- L] [|- L'] -> Howe_cons' [|- H] [|- L] [|- N]
inductive
Howe_cons'
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Howe", "list", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_ev_cons : Howe [ |- list T] [ |- cons H L] [ |- N] -> Howe_cons' [|- H] [|- L] [|- N]
= / total h (howe_ev_cons t a l n h) / fun (Howe_cons h1 h2 (OSimC [_] s)) => let ESim_cons d s1 s2 = (s $[|- ^]) .Sim_cons (Ev_val Val_cons) in Howe_consC d (howe_osim_trans h1 (sim_osim s1)) (howe_osim_trans h2 (sim_osim s2))
rec
howe_ev_cons
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "Howe_cons'", "howe_osim_trans", "list", "s2", "sim_osim" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
abs_sim_trans : {M:[x:term S|- term T[]]}{N:[x:term S|- term T[]]}{P:[x:term S|- term T[]]} ({R:[|- term S]} Sim [|- T] [|- M[R]] [|- N[R]]) -> ({R:[|- term S]} Sim [|- T] [|- N[R]] [|- P[R]]) -> ({R:[|- term S]} Sim [|- T] [|- M[R]] [|- P[R]])
= / total m (abs_sim_trans s t m) / fun [x:term S |- M] [x:term S |- N] [x:term S |- P] e1 e2 [|- R] => sim_trans (e1 [|- R]) (e2 [|- R])
rec
abs_sim_trans
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim", "sim_trans", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_lam : {M:[x:term S |- term T[]]}{N:[x:term S |- term T[]]} ({R:[|- term S]} Sim [|- T] [|- M[R]] [|- N[R]]) -> Sim [|- arr S T] [|- lam \x.M] [|- lam \x.N]
= / total m (sim_lam s t m) / fun [x:term S |- M] [x:term S |- N] s .Sim_lam (Ev_val Val_lam) => ESim_lam (Ev_val Val_lam) s
rec
sim_lam
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Aeq : [ |- term T] -> [ |- term T] -> ctype
= | Refl: Aeq [ |- M] [ |- M]
inductive
Aeq
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ev_value : Eval [|- M] [|- V] -> Value [|- V]
= / total e (ev_value t m v e) / fn e => case e of | Ev_app d1 d2 => ev_value d2 | Ev_val v => v | Ev_fix d => ev_value d | Ev_case_nil d d1 => ev_value d1 | Ev_case_cons [h:term _ , t:term _ |- D] d1 d2 => ev_value d2
rec
ev_value
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Value", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ev_det : Eval [ |- M] [ |- V1] -> Eval [|- M] [ |- V2] -> Aeq [|- V1] [ |- V2]
= / total e (ev_det t m v1 v2 e) / fn e1, e2 => case e1 of | Ev_app m1 m2 => let Ev_app n1 n2 = e2 in let Refl = ev_det m1 n1 in let Refl = ev_det m2 n2 in Refl | Ev_val Val_lam => let Ev_val Val_lam = e2 in Refl | Ev_val Val_unit => let Ev_val Val_unit = e2 in Refl | Ev_val...
rec
ev_det
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Aeq", "Eval", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ev_val : Eval [ |- M] [ |- V] -> Eval [ |- V] [ |- V'] -> Aeq [ |- V] [ |- V']
= / total e (ev_val t m v e) / fun d d' => let v = ev_value d in ev_det (Ev_val v) d'
rec
ev_val
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Aeq", "Eval", "ev_det", "ev_value" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ev_sim' : Eval [|- N] [|- lam \x.R] -> Sim [|- arr S T] [|- M] [|- N] -> Sim [|- arr S T] [|- M] [|- lam \x.R]
= / total e (ev_sim' s t n r e) / fun d s .Sim_lam e => let ESim_lam d' s' = s .Sim_lam e in let Refl = ev_det d d' in ESim_lam (Ev_val Val_lam) s'
rec
ev_sim'
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Sim", "ev_det" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ev_sim : Eval [|- N] [|- N'] -> Sim [|- T] [|- M] [|- N'] -> Sim [|- T] [|- M] [|- N]
= / total e (ev_sim t n n' m e) / fun d s .Sim_lam e => let ESim_lam d' s' = s .Sim_lam e in let Refl = ev_val d d' in ESim_lam d s' | d s .Sim_unit e => let d' = s .Sim_unit e in let Refl = ev_val d d' in d | d s .Sim_nil ...
rec
ev_sim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Sim", "ev_val", "s2" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
fix_sim : {M:[x:term T |- term T[]]} Sim [ |- T] [|- M [fix \x.M]] [|- fix \x.M]
= / total m (fix_sim t m) / fun [x:term top |- M] .Sim_unit d => Ev_fix d | [x:term (list T) |- M] .Sim_nil d => Ev_fix d | [x:term (list T) |- M] .Sim_cons d => ESim_cons (Ev_fix d) sim_refl sim_refl | [x:term (arr S T) |- M] .Sim_lam (d : Eval [ |- M[fix \x.M]] [ |- lam \x.N]) => ESim_lam (Ev_fix d) (ml...
rec
fix_sim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Sim", "fix", "list", "sim_refl", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
case_nil_sim : Eval [|- L] [|- nil] -> Sim [ |- T] [|- M] [|- lcase L M \x.\y.N]
= / total e (case_nil_sim l t m n e) / fun d0 .Sim_unit d => Ev_case_nil d0 d | d0 .Sim_nil d => Ev_case_nil d0 d | d0 .Sim_cons d => ESim_cons (Ev_case_nil d0 d) sim_refl sim_refl | d0 .Sim_lam (d : Eval [ |- M] [ |- lam \x. M']) => ESim_lam (Ev_case_nil d0 d) (mlam R => sim_refl)
rec
case_nil_sim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Sim", "sim_refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
case_cons_sim : Eval [|- P] [|- cons H L] -> {N:[x:term S, y:term (list S[]) |- term T[]]} Sim [ |- T] [|- N[H, L]] [|- lcase P M \x.\y.N]
= / total e (case_cons_sim t s p h l m n e) / fun d0 [x:term _, y:term _ |- N] .Sim_unit d => Ev_case_cons [x:term _, y:term _ |- N] d0 d | d0 [x:term _, y:term _ |- N] .Sim_nil d => Ev_case_cons [x:term _, y:term _ |- N] d0 d | d0 [x:term _, y:term _ |- N] .Sim_cons d => ESim_cons (Ev_case_cons...
rec
case_cons_sim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Sim", "list", "sim_refl", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
down_closed : Eval [|- M] [|- V] -> Howe [|- T] [|- M] [|- N] -> Howe [|- T] [|- V] [|- N]
= / trust / % / total e (down_closed t m n v e) / fn e => fn h => case e of | (Ev_val v) => h | (Ev_app d1 d2) => let (Howe_app h1 (h2:Howe [ |- _] [ |- E2] [ |- E2']) (OSimC [_] s)) = h in let Howe_lam h' (OSimC [_] s') = down_closed d1 h1 in let ESim_lam (d1': Eval [ |- _] [ |- lam \x.M]) s''...
rec
down_closed
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval", "Howe", "case_cons_sim", "case_nil_sim", "ev_sim", "ev_sim'", "fix_sim", "howe_ev_cons", "howe_ev_nil", "howe_osim_trans", "howe_subst", "list", "osim_refl", "osim_trans", "s2", "sim_lam", "sim_osim", "sim_refl", "sim_trans", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_sim : Howe [|- T] [|- M] [|- N] -> Sim [|- T] [|- M] [|- N]
= / trust / fun h .Sim_unit e => howe_ev_unit (down_closed e h) | h .Sim_nil e => howe_ev_nil (down_closed e h) | h .Sim_cons e => let Howe_consC e' h1 h2 = howe_ev_cons (down_closed e h) in ESim_cons e' (howe_sim h1) (howe_sim h2) | h .Sim_lam e => let Howe_absC e' f = howe_ev_abs (d...
rec
howe_sim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "Sim", "down_closed", "howe_ev_abs", "howe_ev_cons", "howe_ev_nil", "howe_ev_unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_osim : (g:ctx) Howe [|- T] [g |- E1] [g |- E2] -> OSim [|- T] [g |- E1] [g |- E2]
= / total h (howe_osim g t e1 e2 h) / fun h => OSimC [_] (mlam $S => howe_sim (howe_subst h (howe_subst_refl [_] $[|- $S])))
rec
howe_osim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "OSim", "ctx", "howe_sim", "howe_subst", "howe_subst_refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
ev1 : Eval [|- app M1 M2] [|- V] -> Eval [|- app (app (lam \x. (lam \y. app x y)) M1) M2] [|- V]
= / total a (ev1 a) / fun d => Ev_app (Ev_app (Ev_val Val_lam) (Ev_val Val_lam)) d
rec
ev1
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Eval" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_cong_app : Howe [|- arr S T] [|- M1] [|- M2] -> Howe [|- S] [|- N1] [|- N2] -> Howe [|- T] [|- app M1 N1] [|- app M2 N2]
= / total a (howe_cong_app a) / fun h1 h2 => Howe_app h1 h2 osim_refl
rec
howe_cong_app
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Howe", "osim_refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_cong_app : Sim [|- arr S T] [|- M1] [|- M2] -> Sim [|- S] [|- N1] [|- N2] -> Sim [|- T] [|- app M1 N1] [|- app M2 N2]
= / total a (sim_cong_app a) / fun s1 s2 => howe_sim (howe_cong_app (sim_howe s1) (sim_howe s2))
rec
sim_cong_app
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim", "howe_cong_app", "howe_sim", "s2", "sim_howe" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_lemma2 : Sim [|- T] [|- app M N] [|- app (app (lam (\u. lam (\w. app u w))) M) N]
= / total a (sim_lemma2 a) / fun .Sim_lam d => ESim_lam (ev1 d) (mlam R => sim_refl) | .Sim_unit d => ev1 d | .Sim_nil d => ev1 d | .Sim_cons d => ESim_cons (ev1 d) sim_refl sim_refl
rec
sim_lemma2
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim", "ev1", "sim_refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_lemma1: {M:[|- term _]} Sim [|- arr T T] [|- lam (\x. app M[] (app M[] x))] [ |- lam (\y. app M[] (app (app (lam (\f. lam (\w. app f w))) M[]) y))]
= / total a (sim_lemma1 a) / fun [|- M] .Sim_lam (Ev_val Val_lam) => ESim_lam (Ev_val Val_lam) (mlam N => sim_cong_app sim_refl sim_lemma2)
rec
sim_lemma1
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim", "sim_cong_app", "sim_lemma2", "sim_refl", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_two_succ_one : Sim [|- arr (arr T T) (arr T T)] [|- lam \f.lam \x.app f (app f x)] [|- app (lam \n. lam \x. lam \y. app x (app (app n x) y)) (lam \f.lam \x.app f x)]
= / total a (sim_two_succ_one a) / fun .Sim_lam (Ev_val Val_lam) => ESim_lam (Ev_app (Ev_val Val_lam) (Ev_val Val_lam)) sim_lemma1
rec
sim_two_succ_one
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe-total.bel
[]
[ "Sim", "sim_lemma1" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Value : [ |- term T] -> ctype
= | Val_lam : Value [ |- lam \x. N] | Val_unit : Value [ |- unit] | Val_nil : Value [ |- nil] | Val_cons : Value [ |- cons M1 M2]
inductive
Value
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "term", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Eval : [ |- term T] -> [ |- term T] -> ctype
= | Ev_app : Eval [ |- M1] [ |- lam (\x. N)] -> Eval [ |- N[M2]] [ |- V] -> Eval [ |- app M1 M2] [ |- V] | Ev_val : Value [ |- V] -> Eval [ |- V] [ |- V] | Ev_fix : Eval [ |- M[fix \x. M]] [ |- V] -> Eval [ |- fix \x. M] [ |- V] | Ev_case_nil : Eval [ |- M] [ |...
inductive
Eval
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Value", "fix", "list", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Sim : {T:[|- tp]} [|- term T] -> [|- term T] -> ctype
= | Sim_unit : Sim [|- top] [|- M] [|- N] :: Eval [ |- M] [ |- unit] -> Eval [ |- N] [ |- unit] | Sim_nil : Sim [|- list T] [|- M] [|- N] :: Eval [ |- M] [ |- nil] -> Eval [ |- N] [|- nil] | Sim_cons : Sim [|- list T] [|- M] [|- N] :: Eval [ |- M] [ |- cons H L] -> Ex_sim_cons [...
coinductive
Sim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Eval", "Ex_sim_cons", "Ex_sim_lam", "list", "term", "tp", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Ex_sim_lam : [x:term S |- term T[]] -> [|- term (arr S T)] -> ctype
= | ESim_lam : Eval [ |- N] [|- lam \x. N'] -> ({R:[|- term S]} Sim [|- T] [|- M'[R]] [|- N'[R]]) -> Ex_sim_lam [x:term S |- M'] [|- N]
inductive
Ex_sim_lam
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Eval", "Sim", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_refl : Sim [|- T] [|- M] [|- M]
= fun .Sim_unit d => d | .Sim_nil d => d | .Sim_cons d => ESim_cons d sim_refl sim_refl | .Sim_lam d => ESim_lam d (mlam R => sim_refl)
rec
sim_refl
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Sim" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_trans : Sim [|- T] [|- M] [|- N] -> Sim [|- T] [|- N] [|- R] -> Sim [|- T] [|- M] [|- R]
= fun s1 s2 .Sim_unit d => s2 .Sim_unit (s1 .Sim_unit d) | s1 s2 .Sim_nil d => s2 .Sim_nil (s1 .Sim_nil d) | s1 s2 .Sim_cons d => let ESim_cons d1 s1' s1'' = s1 .Sim_cons d in let ESim_cons d2 s2' s2'' = s2 .Sim_cons d1 in ESim_cons d2 (sim_trans s1' s2') (sim_trans s1'' s2'') | s1 s2 .Sim_lam d => ...
rec
sim_trans
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Sim", "s2" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
OSim : (g:ctx) {T:[|- tp]} [g |- term T[]] -> [g |- term T[]] -> ctype
= | OSimC : {g:ctx} → ({$S:$[ |- g]} → Sim [|- T] [|- M[$S]] [|- N[$S]]) → OSim [|- T] [g |- M] [g |- N]
inductive
OSim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Sim", "ctx", "term", "tp" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_osim : Sim [|- T] [|- M] [|- N] -> OSim [|- T] [|- M] [|- N]
= fun s => OSimC [] (mlam $S => let $[ |- ^] = $[ |- $S] in s)
rec
sim_osim
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "OSim", "Sim" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
osim_refl : (g:ctx) OSim [|- T] [g |- M] [g |- M]
= OSimC [_] (mlam $S => sim_refl)
rec
osim_refl
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "OSim", "ctx", "sim_refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
osim_trans : (g:ctx) OSim [|- T] [g |- M] [g |- N] -> OSim [|- T] [g |- N] [g |- R] -> OSim [|- T] [g |- M] [g |- R]
= fun (OSimC [g] f1) (OSimC [g] f2) => OSimC [g] (mlam $S => sim_trans (f1 $[|- $S]) (f2 $[|- $S]))
rec
osim_trans
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "OSim", "ctx", "f2", "sim_trans" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
osim_cus : (g:ctx) (h:ctx) {$S:$[h |- g]} OSim [|- T] [g |- M] [g |- N] -> OSim [|- T] [h |- M[$S]] [h |- N[$S]]
= fun $[h |- $S] (OSimC [g] f) => OSimC [h] (mlam $S' => f $[|- $S[$S']])
rec
osim_cus
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "OSim", "ctx" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Howe : (g:ctx) {T:[|- tp]} [g |- term T[]] -> [g |- term T[]] -> ctype
= | Howe_unit : OSim [|- top] [g |- unit] [g |- M] -> Howe [|- top] [g |- unit] [g |- M] | Howe_var : {#p:#[g |- term T[]]} OSim [|- T] [g |- #p] [g |- M] -> Howe [|- T] [g |- #p] [g |- M] | Howe_lam : Howe [|- T] [g, x:term _ |- M] [g, x:term _ |- N] -> OSim [|- arr ...
inductive
Howe
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "OSim", "ctx", "fix", "list", "term", "tp", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_osim_trans : (g:ctx) Howe [|- T] [g |- M] [g |- N] -> OSim [|- T] [g |- N] [g |- R] -> Howe [|- T] [g |- M] [g |- R]
= fun (Howe_unit s1) s2 => Howe_unit (osim_trans s1 s2) | (Howe_var [g |- #p] s1) s2 => Howe_var [g |- #p] (osim_trans s1 s2) | (Howe_lam h1 s1) s2 => Howe_lam h1 (osim_trans s1 s2) | (Howe_app h1 h2 s1) s2 => Howe_app h1 h2 (osim_trans s1 s2) | (Howe_fix h1 s1) s2 => Howe_fix h1 (osim_trans s1 s2) | (Howe_ni...
rec
howe_osim_trans
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe", "OSim", "ctx", "osim_trans", "s2" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_refl : (g:ctx) {M:[g |- term T[]]} Howe [|- T] [g |- M] [g |- M]
= fun [g |- unit] => Howe_unit osim_refl | [g |- #p] => Howe_var [g |- #p] osim_refl | [g |- lam \x. M] => Howe_lam (howe_refl [g, x:term _ |- M]) osim_refl | [g |- app M N] => Howe_app (howe_refl [g |- M]) (howe_refl [g |- N]) osim_refl | [g |- fix \x. M] => Howe_fix (howe_refl [g, x:term _ |- M]) osim_refl ...
rec
howe_refl
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe", "ctx", "fix", "list", "osim_refl", "term", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
osim_howe : (g:ctx) OSim [|- T] [g |- M] [g |- N] -> Howe [|- T] [g |- M] [g |- N]
= fun s => howe_osim_trans (howe_refl _) s
rec
osim_howe
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe", "OSim", "ctx", "howe_osim_trans", "howe_refl" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
sim_howe : Sim [|- T] [|- M] [|- N] -> Howe [|- T] [|- M] [|- N]
= fun s => osim_howe (sim_osim s)
rec
sim_howe
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe", "Sim", "osim_howe", "sim_osim" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_subst_refl : {g:ctx} (h:ctx) {$S:$[h |- g]} Howe_subst [g] $[h |- $S] $[h |- $S]
= fun [] $[h |- ^] => HNil | [g, x:term _] $[h |- $S', M] => HCons (howe_subst_refl [g] $[h |- $S']) (howe_refl [h |- M])
rec
howe_subst_refl
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe_subst", "ctx", "howe_refl", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_ren : {g:ctx}{h:ctx}{$S: $[h |-# g]} Howe [|- T] [g |- M] [g |- N] -> Howe [|- T] [h |- M[$S]] [h |- N[$S]]
= fun [g] [h] $[h |- $S] hr => case hr of | Howe_unit s => Howe_unit (osim_cus $[h |- $S] s) | Howe_var [g |- #p] s => let os = osim_cus $[h |- $S] s in howe_osim_trans (howe_refl [h |- #p[$S]]) os | Howe_lam h' s => Howe_lam (howe_ren [g, x:term _] [h, x:term _] $[h, x:term _ |- $S[..], x] h') (osim_cus $[...
rec
howe_ren
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe", "ctx", "howe_osim_trans", "howe_refl", "osim_cus", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_subst_wkn : (g:ctx) (h:ctx) {S:[|-tp]} Howe_subst [g] $[h |- $S1] $[h |- $S2] -> Howe_subst [g] $[h, x:term S[] |- $S1[..]] $[h, x:term S[] |- $S2[..]]
= fun | [|- S] HNil => HNil | [|- S] (HCons hs' h') => HCons (howe_subst_wkn [|- S] hs') (howe_ren [_] [_, x:term S[]] $[_, x:term S[] |- ..] h')
rec
howe_subst_wkn
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe_subst", "ctx", "howe_ren", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_subst_var : (g:ctx) (h:ctx) Howe [|- T] [g |- #p] [g |- M] -> Howe_subst [g] $[h |- $S1] $[h |- $S2] -> Howe [|- T] [h |- #p[$S1]] [h |- M[$S2]]
= fun ho hs => let hs:Howe_subst [g] $[h |- $S1] $[h |- $S2] = hs in case ho of | Howe_var [g, x:term T[] |- x] s => let HCons hs' h' = hs in howe_osim_trans h' (osim_cus $[h |- $S2] s) | Howe_var [g, x:term T[] |- #p[..]] s => let HCons (hs':Howe_subst [g] $[h |- $S1'] $[h |- $S2']) ...
rec
howe_subst_var
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe", "Howe_subst", "ctx", "howe_osim_trans", "howe_refl", "osim_cus", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_subst : (g:ctx) (h:ctx) Howe [|- T] [g |- M] [g |- N] -> Howe_subst [g] $[h |- $S1] $[h |- $S2] -> Howe [|- T] $[h |- M[$S1]] [h |- N[$S2]]
= fun ho hs => let hs : Howe_subst [g] $[h |- $S1] $[h |- $S2] = hs in case ho of | Howe_unit s => howe_osim_trans (howe_refl [h |- _]) (osim_cus $[h |- $S2] s) | Howe_var [g |- #p] s => howe_subst_var ho hs | Howe_lam h' s => Howe_lam (howe_subst h' (HCons (howe_subst_wkn _ hs) (howe_refl [h, x:term ...
rec
howe_subst
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe", "Howe_subst", "ctx", "howe_osim_trans", "howe_refl", "howe_subst_var", "howe_subst_wkn", "osim_cus", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
Howe_abs : [x:term S |- term T[]] -> [|- term (arr S T)] -> ctype
= | Howe_absC : Eval [ |- N] [|- lam \x. N'] -> ({R:[|- term S]} Howe [|- T][|- M' [R]] [|- N' [R]]) -> Howe_abs [x:term S |- M'] [|- N]
inductive
Howe_abs
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Eval", "Howe", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_ev_abs : Howe [ |- arr S T] [|- lam \x. M'] [|- N] -> Howe_abs [x:term S |- M'] [|- N]
= fun (Howe_lam h' (OSimC [_] s)) => let ESim_lam d f = (s $[|- ^]) .Sim_lam (Ev_val Val_lam) in Howe_absC d (mlam R => let a = sim_osim (f [|- R]) in let h'' = howe_subst h' (HCons HNil (howe_refl [|- R])) in howe_osim_trans h'' a)
rec
howe_ev_abs
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Howe", "Howe_abs", "howe_osim_trans", "howe_refl", "howe_subst", "sim_osim", "term" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303
howe_ev_unit : Howe [ |- top] [ |- unit] [ |- N] -> Eval [ |- N] [ |- unit]
= fun (Howe_unit (OSimC [_]f)) => (f $[|- ^]) .Sim_unit (Ev_val Val_unit)
rec
howe_ev_unit
examples/codatatypes/howes-method
examples/codatatypes/howes-method/howe.bel
[]
[ "Eval", "Howe", "unit" ]
https://github.com/Beluga-lang/Beluga
820615cc4758086eb7641f62340a3ab93a689303