comparison lib/ur/top.urs @ 1093:8d3aa6c7cee0

Make summary unification more conservative; infer implicit arguments after applications
author Adam Chlipala <adamc@hcoop.net>
date Sat, 26 Dec 2009 11:56:40 -0500
parents 25d491287358
children 7fc4e0087e50
comparison
equal deleted inserted replaced
1092:6f4b05fc4361 1093:8d3aa6c7cee0
4 4
5 val fold : K --> tf :: ({K} -> Type) 5 val fold : K --> tf :: ({K} -> Type)
6 -> (nm :: Name -> v :: K -> r :: {K} -> [[nm] ~ r] => 6 -> (nm :: Name -> v :: K -> r :: {K} -> [[nm] ~ r] =>
7 tf r -> tf ([nm = v] ++ r)) 7 tf r -> tf ([nm = v] ++ r))
8 -> tf [] 8 -> tf []
9 -> r :: {K} -> folder r -> tf r 9 -> r ::: {K} -> folder r -> tf r
10 10
11 structure Folder : sig 11 structure Folder : sig
12 val nil : K --> folder (([]) :: {K}) 12 val nil : K --> folder (([]) :: {K})
13 val cons : K --> r ::: {K} -> nm :: Name -> v :: K 13 val cons : K --> r ::: {K} -> nm :: Name -> v :: K
14 -> [[nm] ~ r] => folder r -> folder ([nm = v] ++ r) 14 -> [[nm] ~ r] => folder r -> folder ([nm = v] ++ r)
45 val txt : t ::: Type -> ctx ::: {Unit} -> use ::: {Type} -> show t -> t 45 val txt : t ::: Type -> ctx ::: {Unit} -> use ::: {Type} -> show t -> t
46 -> xml ctx use [] 46 -> xml ctx use []
47 47
48 val map0 : K --> tf :: (K -> Type) 48 val map0 : K --> tf :: (K -> Type)
49 -> (t :: K -> tf t) 49 -> (t :: K -> tf t)
50 -> r :: {K} -> folder r -> $(map tf r) 50 -> r ::: {K} -> folder r -> $(map tf r)
51 val mp : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) 51 val mp : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
52 -> (t ::: K -> tf1 t -> tf2 t) 52 -> (t ::: K -> tf1 t -> tf2 t)
53 -> r :: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) 53 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r)
54 val map2 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf :: (K -> Type) 54 val map2 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf :: (K -> Type)
55 -> (t ::: K -> tf1 t -> tf2 t -> tf t) 55 -> (t ::: K -> tf1 t -> tf2 t -> tf t)
56 -> r :: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf r) 56 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf r)
57 val map3 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type) -> tf :: (K -> Type) 57 val map3 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type) -> tf :: (K -> Type)
58 -> (t ::: K -> tf1 t -> tf2 t -> tf3 t -> tf t) 58 -> (t ::: K -> tf1 t -> tf2 t -> tf3 t -> tf t)
59 -> r :: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> $(map tf r) 59 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> $(map tf r)
60 60
61 val foldUR : tf :: Type -> tr :: ({Unit} -> Type) 61 val foldUR : tf :: Type -> tr :: ({Unit} -> Type)
62 -> (nm :: Name -> rest :: {Unit} 62 -> (nm :: Name -> rest :: {Unit}
63 -> [[nm] ~ rest] => 63 -> [[nm] ~ rest] =>
64 tf -> tr rest -> tr ([nm] ++ rest)) 64 tf -> tr rest -> tr ([nm] ++ rest))
65 -> tr [] -> r :: {Unit} -> folder r -> $(mapU tf r) -> tr r 65 -> tr [] -> r ::: {Unit} -> folder r -> $(mapU tf r) -> tr r
66 66
67 val foldUR2 : tf1 :: Type -> tf2 :: Type -> tr :: ({Unit} -> Type) 67 val foldUR2 : tf1 :: Type -> tf2 :: Type -> tr :: ({Unit} -> Type)
68 -> (nm :: Name -> rest :: {Unit} 68 -> (nm :: Name -> rest :: {Unit}
69 -> [[nm] ~ rest] => 69 -> [[nm] ~ rest] =>
70 tf1 -> tf2 -> tr rest -> tr ([nm] ++ rest)) 70 tf1 -> tf2 -> tr rest -> tr ([nm] ++ rest))
71 -> tr [] -> r :: {Unit} -> folder r -> $(mapU tf1 r) -> $(mapU tf2 r) -> tr r 71 -> tr [] -> r ::: {Unit} -> folder r -> $(mapU tf1 r) -> $(mapU tf2 r) -> tr r
72 72
73 val foldURX2: tf1 :: Type -> tf2 :: Type -> ctx :: {Unit} 73 val foldURX2: tf1 :: Type -> tf2 :: Type -> ctx :: {Unit}
74 -> (nm :: Name -> rest :: {Unit} 74 -> (nm :: Name -> rest :: {Unit}
75 -> [[nm] ~ rest] => 75 -> [[nm] ~ rest] =>
76 tf1 -> tf2 -> xml ctx [] []) 76 tf1 -> tf2 -> xml ctx [] [])
77 -> r :: {Unit} -> folder r -> $(mapU tf1 r) -> $(mapU tf2 r) -> xml ctx [] [] 77 -> r ::: {Unit} -> folder r -> $(mapU tf1 r) -> $(mapU tf2 r) -> xml ctx [] []
78 78
79 val foldR : K --> tf :: (K -> Type) -> tr :: ({K} -> Type) 79 val foldR : K --> tf :: (K -> Type) -> tr :: ({K} -> Type)
80 -> (nm :: Name -> t :: K -> rest :: {K} 80 -> (nm :: Name -> t :: K -> rest :: {K}
81 -> [[nm] ~ rest] => 81 -> [[nm] ~ rest] =>
82 tf t -> tr rest -> tr ([nm = t] ++ rest)) 82 tf t -> tr rest -> tr ([nm = t] ++ rest))
83 -> tr [] -> r :: {K} -> folder r -> $(map tf r) -> tr r 83 -> tr [] -> r ::: {K} -> folder r -> $(map tf r) -> tr r
84 84
85 val foldR2 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) 85 val foldR2 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
86 -> tr :: ({K} -> Type) 86 -> tr :: ({K} -> Type)
87 -> (nm :: Name -> t :: K -> rest :: {K} 87 -> (nm :: Name -> t :: K -> rest :: {K}
88 -> [[nm] ~ rest] => 88 -> [[nm] ~ rest] =>
89 tf1 t -> tf2 t -> tr rest -> tr ([nm = t] ++ rest)) 89 tf1 t -> tf2 t -> tr rest -> tr ([nm = t] ++ rest))
90 -> tr [] 90 -> tr []
91 -> r :: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> tr r 91 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> tr r
92 92
93 val foldR3 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type) 93 val foldR3 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type)
94 -> tr :: ({K} -> Type) 94 -> tr :: ({K} -> Type)
95 -> (nm :: Name -> t :: K -> rest :: {K} 95 -> (nm :: Name -> t :: K -> rest :: {K}
96 -> [[nm] ~ rest] => 96 -> [[nm] ~ rest] =>
97 tf1 t -> tf2 t -> tf3 t -> tr rest -> tr ([nm = t] ++ rest)) 97 tf1 t -> tf2 t -> tf3 t -> tr rest -> tr ([nm = t] ++ rest))
98 -> tr [] 98 -> tr []
99 -> r :: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> tr r 99 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> tr r
100 100
101 val foldRX : K --> tf :: (K -> Type) -> ctx :: {Unit} 101 val foldRX : K --> tf :: (K -> Type) -> ctx :: {Unit}
102 -> (nm :: Name -> t :: K -> rest :: {K} 102 -> (nm :: Name -> t :: K -> rest :: {K}
103 -> [[nm] ~ rest] => 103 -> [[nm] ~ rest] =>
104 tf t -> xml ctx [] []) 104 tf t -> xml ctx [] [])
105 -> r :: {K} -> folder r -> $(map tf r) -> xml ctx [] [] 105 -> r ::: {K} -> folder r -> $(map tf r) -> xml ctx [] []
106 106
107 val foldRX2 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> ctx :: {Unit} 107 val foldRX2 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> ctx :: {Unit}
108 -> (nm :: Name -> t :: K -> rest :: {K} 108 -> (nm :: Name -> t :: K -> rest :: {K}
109 -> [[nm] ~ rest] => 109 -> [[nm] ~ rest] =>
110 tf1 t -> tf2 t -> xml ctx [] []) 110 tf1 t -> tf2 t -> xml ctx [] [])
111 -> r :: {K} -> folder r 111 -> r ::: {K} -> folder r
112 -> $(map tf1 r) -> $(map tf2 r) -> xml ctx [] [] 112 -> $(map tf1 r) -> $(map tf2 r) -> xml ctx [] []
113 113
114 val foldRX3 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type) -> ctx :: {Unit} 114 val foldRX3 : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type) -> ctx :: {Unit}
115 -> (nm :: Name -> t :: K -> rest :: {K} 115 -> (nm :: Name -> t :: K -> rest :: {K}
116 -> [[nm] ~ rest] => 116 -> [[nm] ~ rest] =>
117 tf1 t -> tf2 t -> tf3 t -> xml ctx [] []) 117 tf1 t -> tf2 t -> tf3 t -> xml ctx [] [])
118 -> r :: {K} -> folder r 118 -> r ::: {K} -> folder r
119 -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> xml ctx [] [] 119 -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> xml ctx [] []
120 120
121 val queryL : tables ::: {{Type}} -> exps ::: {Type} 121 val queryL : tables ::: {{Type}} -> exps ::: {Type}
122 -> [tables ~ exps] => 122 -> [tables ~ exps] =>
123 sql_query tables exps 123 sql_query tables exps