comparison incl.urs @ 5:943410267fad

Import Incl and Mem
author Adam Chlipala <adam@chlipala.net>
date Tue, 14 Dec 2010 09:49:10 -0500
parents
children
comparison
equal deleted inserted replaced
4:8f7396495045 5:943410267fad
1 (** A record inclusion predicate *)
2
3 con incl :: K --> {K} -> {K} -> Type
4
5 val incl : K --> r1 :: {K} -> r2 :: {K} -> [r1 ~ r2] => incl r1 (r1 ++ r2)
6 val proj : r1 ::: {Type} -> r2 ::: {Type} -> incl r1 r2 -> $r2 -> $r1
7
8 val inv1 : K --> nm :: Name -> t :: K -> r :: {K} -> r' :: {K}
9 -> [[nm] ~ r] =>
10 f :: (Name -> K -> {K} -> Type)
11 -> incl ([nm = t] ++ r) r'
12 -> (nm :: Name -> t :: K -> r :: {K} -> [[nm] ~ r] => f nm t ([nm = t] ++ r))
13 -> f nm t r'
14 val inv2 : K --> nm :: Name -> t :: K -> r :: {K} -> r' :: {K}
15 -> [[nm] ~ r] =>
16 incl ([nm = t] ++ r) r' -> incl r r'
17
18 val fold : K --> tf :: ({K} -> Type) -> r ::: {K}
19 -> (nm :: Name -> v :: K -> r' :: {K}
20 -> [[nm] ~ r'] => incl ([nm = v] ++ r') r -> tf r' -> tf ([nm = v] ++ r'))
21 -> tf []
22 -> folder r -> tf r