| Cic.AProd (id,n,s,t) ->
let binder_kind =
match sort_of_id id with
- | `Set | `Type _ -> `Pi
+ | `Set | `Type _ | `NType _ -> `Pi
| `Prop | `CProp _ -> `Forall
in
idref id (Ast.Binder (binder_kind,
exception Interpretation_not_found
-let lookup_interpretations symbol =
+let lookup_interpretations ?(sorted=true) symbol =
try
- HExtlib.list_uniq
- (List.sort Pervasives.compare
- (List.map
- (fun id ->
- let (dsc, _, args, appl_pattern) =
- try
- Hashtbl.find !level2_patterns32 id
- with Not_found -> assert false
- in
- dsc, args, appl_pattern)
- !(Hashtbl.find !interpretations symbol)))
+ let raw =
+ List.map (
+ fun id ->
+ let (dsc, _, args, appl_pattern) =
+ try
+ Hashtbl.find !level2_patterns32 id
+ with Not_found -> assert false
+ in
+ dsc, args, appl_pattern
+ )
+ !(Hashtbl.find !interpretations symbol)
+ in
+ if sorted then HExtlib.list_uniq (List.sort Pervasives.compare raw)
+ else raw
with Not_found -> raise Interpretation_not_found
let remove_interpretation id =