From 7865cb372d95c42542d59cbcf83ba541b0ab3f8a Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 24 Feb 2009 12:01:24 -0500 Subject: Switch to TDisjoint from CDisjoint; still need to implement obligation generation at EDisjoint uses --- lib/ur/top.ur | 12 ++++++++++++ lib/ur/top.urs | 2 ++ 2 files changed, 14 insertions(+) (limited to 'lib') diff --git a/lib/ur/top.ur b/lib/ur/top.ur index 5d2ae606..79d30354 100644 --- a/lib/ur/top.ur +++ b/lib/ur/top.ur @@ -17,6 +17,18 @@ structure Folder = struct (f : nm :: Name -> v :: K -> r :: {K} -> tf r -> fn [[nm] ~ r] => tf ([nm = v] ++ r)) (i : tf []) = f [nm] [v] [r] (fold [tf] f i) + + fun concat K (r1 ::: {K}) (r2 ::: {K}) [r1 ~ r2] + (f1 : folder r1) (f2 : folder r2) + (tf :: {K} -> Type) + (f : nm :: Name -> v :: K -> r :: {K} -> tf r + -> fn [[nm] ~ r] => tf ([nm = v] ++ r)) + (i : tf []) = + f1 [fn r1' [r1' ~ r2] => tf (r1' ++ r2)] 0 + (*(fn (nm :: Name) (v :: K) (r1' :: {K}) (acc : fn [r1' ~ r2] => tf (r1' ++ r2)) + [[nm] ~ r1'] [[nm = v] ++ r1' ~ r2] => + f [nm] [v] [r1' ++ r2] acc) + (f2 [tf] f i)*) end diff --git a/lib/ur/top.urs b/lib/ur/top.urs index d4cd34f4..563f6afd 100644 --- a/lib/ur/top.urs +++ b/lib/ur/top.urs @@ -10,6 +10,8 @@ structure Folder : sig val nil : K --> folder (([]) :: {K}) val cons : K --> r ::: {K} -> nm :: Name -> v :: K -> fn [[nm] ~ r] => folder r -> folder ([nm = v] ++ r) + val concat : K --> r1 ::: {K} -> r2 ::: {K} + -> fn [r1 ~ r2] => folder r1 -> folder r2 -> folder (r1 ++ r2) end -- cgit v1.2.3