2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
12 (* $Id: nCic.ml 9058 2008-10-13 17:42:30Z tassi $ *)
16 open DisambiguateTypes
18 module Ast = NotationPt
19 module NRef = NReference
21 let debug_print s = prerr_endline (Lazy.force s);;
22 let debug_print _ = ();;
24 let cic_name_of_name = function
25 | Ast.Ident (n, None) -> n
29 let rec mk_rels howmany from =
32 | _ -> (NCic.Rel (howmany + from)) :: (mk_rels (howmany-1) from)
36 metasenv subst context uri ~rdb ~use_coercions term expty _ ~localization_tbl=
38 debug_print (lazy (sprintf "TEST_INTERPRETATION: %s"
39 (NCicPp.ppterm ~metasenv ~subst ~context term)));
42 try NCicUntrusted.NCicHash.find localization_tbl t
44 prerr_endline ("NOT LOCALISED" ^ NCicPp.ppterm ~metasenv ~subst ~context t);
45 (*assert false*) HExtlib.dummy_floc
47 let metasenv, subst, term, _ =
50 (if use_coercions then rdb#coerc_db else NCicCoercion.empty_db))
51 metasenv subst context term expty ~localise
53 Disambiguate.Ok (term, metasenv, subst, ())
55 | NCicRefiner.Uncertain loc_msg ->
56 debug_print (lazy ("UNCERTAIN: [" ^ snd (Lazy.force loc_msg) ^ "] " ^
57 NCicPp.ppterm ~metasenv ~subst ~context term)) ;
58 Disambiguate.Uncertain loc_msg
59 | NCicRefiner.RefineFailure loc_msg ->
60 debug_print (lazy (sprintf "PRUNED:\nterm%s\nmessage:%s"
61 (NCicPp.ppterm ~metasenv ~subst ~context term) (snd(Lazy.force loc_msg))));
62 Disambiguate.Ko loc_msg
66 ~rdb metasenv subst _context _uri
67 ~use_coercions obj _ _ugraph ~localization_tbl
72 try NCicUntrusted.NCicHash.find localization_tbl t
74 (*assert false*)HExtlib.dummy_floc
78 NCicRefiner.typeof_obj
80 (if use_coercions then rdb#coerc_db
81 else NCicCoercion.empty_db))
84 Disambiguate.Ok (obj, [], [], ())
86 | NCicRefiner.Uncertain loc_msg ->
87 debug_print (lazy ("UNCERTAIN: [" ^ snd (Lazy.force loc_msg) ^ "] " ^
89 Disambiguate.Uncertain loc_msg
90 | NCicRefiner.RefineFailure loc_msg ->
91 debug_print (lazy (sprintf "PRUNED:\nobj: %s\nmessage: %s"
92 (NCicPp.ppobj obj) (snd(Lazy.force loc_msg))));
93 Disambiguate.Ko loc_msg
97 (* TODO move it to Cic *)
98 let find_in_context name context =
99 let rec aux acc = function
100 | [] -> raise Not_found
101 | hd :: _ when hd = name -> acc
102 | _ :: tl -> aux (acc + 1) tl
106 let interpretate_term_and_interpretate_term_option
107 ?(create_dummy_ids=false)
108 ~obj_context ~mk_choice ~env ~uri ~is_path ~localization_tbl
110 (* create_dummy_ids shouldbe used only for interpretating patterns *)
113 let rec aux ~localize loc context = function
114 | NotationPt.AttributedTerm (`Loc loc, term) ->
115 let res = aux ~localize loc context term in
117 NCicUntrusted.NCicHash.add localization_tbl res loc;
119 | NotationPt.AttributedTerm (_, term) -> aux ~localize loc context term
120 | NotationPt.Appl (NotationPt.Appl inner :: args) ->
121 aux ~localize loc context (NotationPt.Appl (inner @ args))
123 (NotationPt.AttributedTerm (att,(NotationPt.Appl inner))::args)->
124 aux ~localize loc context
125 (NotationPt.AttributedTerm (att,NotationPt.Appl (inner @ args)))
126 | NotationPt.Appl (NotationPt.Symbol (symb, i) :: args) ->
127 let cic_args = List.map (aux ~localize loc context) args in
128 Disambiguate.resolve ~mk_choice ~env (Symbol (symb, i)) (`Args cic_args)
129 | NotationPt.Appl terms ->
130 NCic.Appl (List.map (aux ~localize loc context) terms)
131 | NotationPt.Binder (binder_kind, (var, typ), body) ->
132 let cic_type = aux_option ~localize loc context `Type typ in
133 let cic_name = cic_name_of_name var in
134 let cic_body = aux ~localize loc (cic_name :: context) body in
135 (match binder_kind with
136 | `Lambda -> NCic.Lambda (cic_name, cic_type, cic_body)
138 | `Forall -> NCic.Prod (cic_name, cic_type, cic_body)
140 Disambiguate.resolve ~env ~mk_choice (Symbol ("exists", 0))
141 (`Args [ cic_type; NCic.Lambda (cic_name, cic_type, cic_body) ]))
142 | NotationPt.Case (term, indty_ident, outtype, branches) ->
143 let cic_term = aux ~localize loc context term in
144 let cic_outtype = aux_option ~localize loc context `Term outtype in
145 let do_branch ((_, _, args), term) =
146 let rec do_branch' context = function
147 | [] -> aux ~localize loc context term
148 | (name, typ) :: tl ->
149 let cic_name = cic_name_of_name name in
150 let cic_body = do_branch' (cic_name :: context) tl in
153 | None -> NCic.Implicit `Type
154 | Some typ -> aux ~localize loc context typ
156 NCic.Lambda (cic_name, typ, cic_body)
158 do_branch' context args
160 if create_dummy_ids then
164 Ast.Wildcard,term -> ("wildcard",None,[]), term
166 raise (DisambiguateTypes.Invalid_choice
167 (lazy (loc, "Syntax error: the left hand side of a "^
168 "branch pattern must be \"_\"")))
172 NCic.MutCase (ref, cic_outtype, cic_term,
173 (List.map do_branch branches))
174 *) ignore branches; assert false (* patterns not implemented yet *)
177 match indty_ident with
178 | Some (indty_ident, _) ->
179 (match Disambiguate.resolve ~env ~mk_choice
180 (Id indty_ident) (`Args []) with
181 | NCic.Const (NReference.Ref (_,NReference.Ind _) as r) -> r
183 raise (Disambiguate.Try_again
184 (lazy "The type of the term to be matched is still unknown"))
186 raise (DisambiguateTypes.Invalid_choice
187 (lazy (loc,"The type of the term to be matched "^
188 "is not (co)inductive: " ^ NCicPp.ppterm
189 ~metasenv:[] ~subst:[] ~context:[] t))))
191 let rec fst_constructor =
193 (Ast.Pattern (head, _, _), _) :: _ -> head
194 | (Ast.Wildcard, _) :: tl -> fst_constructor tl
195 | [] -> raise (Invalid_choice (lazy (loc,"The type "^
196 "of the term to be matched cannot be determined "^
197 "because it is an inductive type without constructors "^
198 "or because all patterns use wildcards")))
201 DisambiguateTypes.Environment.iter
204 (DisambiguateTypes.string_of_domain_item k ^ " => " ^
205 description_of_alias v)) env;
207 (match Disambiguate.resolve ~env ~mk_choice
208 (Id (fst_constructor branches)) (`Args []) with
209 | NCic.Const (NReference.Ref (_,NReference.Con _) as r) ->
210 let b,_,_,_,_ = NCicEnvironment.get_checked_indtys r in
211 NReference.mk_indty b r
213 raise (Disambiguate.Try_again
214 (lazy "The type of the term to be matched is still unknown"))
216 raise (DisambiguateTypes.Invalid_choice
218 "The type of the term to be matched is not (co)inductive: "
219 ^ NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] t))))
221 let _,leftsno,itl,_,indtyp_no =
222 NCicEnvironment.get_checked_indtys indtype_ref in
225 List.nth itl indtyp_no
226 with _ -> assert false in
227 let rec count_prod t =
228 match NCicReduction.whd ~subst:[] [] t with
229 NCic.Prod (_, _, t) -> 1 + (count_prod t)
232 let rec sort branches cl =
235 let rec analyze unused unrecognized useless =
238 if unrecognized != [] then
239 raise (DisambiguateTypes.Invalid_choice
241 (loc,"Unrecognized constructors: " ^
242 String.concat " " unrecognized)))
243 else if useless > 0 then
244 raise (DisambiguateTypes.Invalid_choice
246 (loc,"The last " ^ string_of_int useless ^
247 "case" ^ if useless > 1 then "s are" else " is" ^
251 | (Ast.Wildcard,_)::tl when not unused ->
252 analyze true unrecognized useless tl
253 | (Ast.Pattern (head,_,_),_)::tl when not unused ->
254 analyze unused (head::unrecognized) useless tl
255 | _::tl -> analyze unused unrecognized (useless + 1) tl
257 analyze false [] 0 branches
258 | (_,name,ty)::cltl ->
259 let rec find_and_remove =
263 (DisambiguateTypes.Invalid_choice
264 (lazy (loc, "Missing case: " ^ name)))
265 | ((Ast.Wildcard, _) as branch :: _) as branches ->
267 | (Ast.Pattern (name',_,_),_) as branch :: tl
271 let found,rest = find_and_remove tl in
274 let branch,tl = find_and_remove branches in
276 Ast.Pattern (name,y,args),term ->
277 if List.length args = count_prod ty - leftsno then
278 ((name,y,args),term)::sort tl cltl
281 (DisambiguateTypes.Invalid_choice
282 (lazy (loc,"Wrong number of arguments for " ^ name)))
283 | Ast.Wildcard,term ->
289 (`Lambda, (NotationPt.Ident ("_", None), None),
292 (("wildcard",None,[]),
293 mk_lambdas (count_prod ty - leftsno)) :: sort tl cltl
295 let branches = sort branches cl in
296 NCic.Match (indtype_ref, cic_outtype, cic_term,
297 (List.map do_branch branches))
298 | NotationPt.Cast (t1, t2) ->
299 let cic_t1 = aux ~localize loc context t1 in
300 let cic_t2 = aux ~localize loc context t2 in
301 NCic.LetIn ("_",cic_t2,cic_t1, NCic.Rel 1)
302 | NotationPt.LetIn ((name, typ), def, body) ->
303 let cic_def = aux ~localize loc context def in
304 let cic_name = cic_name_of_name name in
307 | None -> NCic.Implicit `Type
308 | Some t -> aux ~localize loc context t
310 let cic_body = aux ~localize loc (cic_name :: context) body in
311 NCic.LetIn (cic_name, cic_typ, cic_def, cic_body)
312 | NotationPt.LetRec (_kind, _defs, _body) -> NCic.Implicit `Term
315 | NotationPt.NRef _ when is_path -> raise Disambiguate.PathNotWellFormed
316 | NotationPt.Ident (name, subst) ->
317 assert (subst = None);
319 NCic.Rel (find_in_context name context)
321 try NCic.Const (List.assoc name obj_context)
323 Disambiguate.resolve ~env ~mk_choice (Id name) (`Args []))
324 | NotationPt.Uri (uri, subst) ->
325 assert (subst = None);
327 NCic.Const (NReference.reference_of_string uri)
328 with NRef.IllFormedReference _ ->
329 NotationPt.fail loc "Ill formed reference")
330 | NotationPt.NRef nref -> NCic.Const nref
331 | NotationPt.NCic t ->
332 let context = (* to make metas_of_term happy *)
333 List.map (fun x -> x,NCic.Decl (NCic.Implicit `Type)) context in
334 assert(NCicUntrusted.metas_of_term [] context t = []); t
335 | NotationPt.Implicit `Vector -> NCic.Implicit `Vector
336 | NotationPt.Implicit `JustOne -> NCic.Implicit `Term
337 | NotationPt.Implicit (`Tagged s) -> NCic.Implicit (`Tagged s)
338 | NotationPt.UserInput -> NCic.Implicit `Hole
339 | NotationPt.Num (num, i) ->
340 Disambiguate.resolve ~env ~mk_choice (Num i) (`Num_arg num)
341 | NotationPt.Meta (index, subst) ->
344 (function None -> assert false| Some t -> aux ~localize loc context t)
347 NCic.Meta (index, (0, NCic.Ctx cic_subst))
348 | NotationPt.Sort `Prop -> NCic.Sort NCic.Prop
349 | NotationPt.Sort `Set -> NCic.Sort (NCic.Type
350 [`Type,NUri.uri_of_string "cic:/matita/pts/Type.univ"])
351 | NotationPt.Sort (`NType s) -> NCic.Sort (NCic.Type
352 [`Type,NUri.uri_of_string ("cic:/matita/pts/Type" ^ s ^ ".univ")])
353 | NotationPt.Sort (`NCProp s) -> NCic.Sort (NCic.Type
354 [`CProp,NUri.uri_of_string ("cic:/matita/pts/Type" ^ s ^ ".univ")])
355 | NotationPt.Symbol (symbol, instance) ->
356 Disambiguate.resolve ~env ~mk_choice
357 (Symbol (symbol, instance)) (`Args [])
358 | NotationPt.Variable _
360 | NotationPt.Layout _
361 | NotationPt.Literal _ -> assert false (* god bless Bologna *)
362 and aux_option ~localize loc context annotation = function
363 | None -> NCic.Implicit annotation
364 | Some (NotationPt.AttributedTerm (`Loc loc, term)) ->
365 let res = aux_option ~localize loc context annotation (Some term) in
367 NCicUntrusted.NCicHash.add localization_tbl res loc;
369 | Some (NotationPt.AttributedTerm (_, term)) ->
370 aux_option ~localize loc context annotation (Some term)
371 | Some NotationPt.Implicit `JustOne -> NCic.Implicit annotation
372 | Some NotationPt.Implicit `Vector -> NCic.Implicit `Vector
373 | Some term -> aux ~localize loc context term
375 (fun ~context -> aux ~localize:true HExtlib.dummy_floc context),
376 (fun ~context -> aux_option ~localize:true HExtlib.dummy_floc context)
379 let interpretate_term ?(create_dummy_ids=false) ~context ~env ~uri ~is_path ast
380 ~obj_context ~localization_tbl ~mk_choice
382 let context = List.map fst context in
384 (interpretate_term_and_interpretate_term_option
385 ~obj_context ~mk_choice ~create_dummy_ids ~env ~uri ~is_path ~localization_tbl)
389 let interpretate_term_option
390 ?(create_dummy_ids=false) ~context ~env ~uri ~is_path
391 ~localization_tbl ~mk_choice ~obj_context
393 let context = List.map fst context in
395 (interpretate_term_and_interpretate_term_option
396 ~obj_context ~mk_choice ~create_dummy_ids ~env ~uri ~is_path ~localization_tbl)
400 let disambiguate_path path =
401 let localization_tbl = NCicUntrusted.NCicHash.create 23 in
403 (interpretate_term_and_interpretate_term_option
404 ~obj_context:[] ~mk_choice:(fun _ -> assert false)
405 ~create_dummy_ids:true ~env:DisambiguateTypes.Environment.empty
406 ~uri:None ~is_path:true ~localization_tbl) ~context:[] path
409 let ncic_name_of_ident = function
410 | Ast.Ident (name, None) -> name
415 (* ?(create_dummy_ids=false) *)
416 ~context ~env ~uri ~is_path obj ~localization_tbl ~mk_choice
418 assert (context = []);
419 assert (is_path = false);
420 let interpretate_term ~obj_context =
421 interpretate_term ~mk_choice ~localization_tbl ~obj_context in
422 let interpretate_term_option ~obj_context =
423 interpretate_term_option ~mk_choice ~localization_tbl ~obj_context in
424 let uri = match uri with | None -> assert false | Some u -> u in
426 | NotationPt.Theorem (flavour, name, ty, bo, pragma) ->
429 ~obj_context:[] ~context:[] ~env ~uri:None ~is_path:false ty
431 let height = (* XXX calculate *) 0 in
433 (match bo,flavour with
435 let attrs = `Provided, flavour, pragma in
436 NCic.Constant ([],name,None,ty',attrs)
437 | Some _,`Axiom -> assert false
439 let attrs = `Provided, flavour, pragma in
440 NCic.Constant ([],name,Some (NCic.Implicit `Term),ty',attrs)
443 | NotationPt.LetRec (kind, defs, _) ->
444 let inductive = kind = `Inductive in
447 (fun (i,acc) (_,(name,_),_,k) ->
449 (ncic_name_of_ident name, NReference.reference_of_spec uri
450 (if inductive then NReference.Fix (i,k,0)
451 else NReference.CoFix i)) :: acc))
456 (fun (params, (name, typ), body, decr_idx) ->
457 let add_binders kind t =
460 NotationPt.Binder (kind, var, t)) params t
464 ~obj_context ~context ~env ~uri:None ~is_path:false
465 (add_binders `Lambda body)
468 interpretate_term_option
470 ~context ~env ~uri:None ~is_path:false `Type
471 (HExtlib.map_option (add_binders `Pi) typ)
473 ([],ncic_name_of_ident name, decr_idx, cic_type, cic_body))
476 let attrs = `Provided, flavour, pragma in
477 NCic.Fixpoint (inductive,inductiveFuns,attrs)
481 ~obj_context:[] ~context:[] ~env ~uri:None ~is_path:false bo
483 let attrs = `Provided, flavour, pragma in
484 NCic.Constant ([],name,Some bo,ty',attrs)))
485 | NotationPt.Inductive (params,tyl) ->
489 (fun (context,res) (name,t) ->
492 None -> NotationPt.Implicit `JustOne
494 let name = cic_name_of_name name in
496 interpretate_term ~obj_context:[] ~context ~env ~uri:None
499 (name,NCic.Decl t)::context,(name,t)::res
502 context,List.rev res in
504 List.fold_right (fun (name,ty) t -> NCic.Prod (name,ty,t)) params in
505 let leftno = List.length params in
506 let _,inductive,_,_ = try List.hd tyl with Failure _ -> assert false in
510 (fun (i,res) (name,_,_,_) ->
512 NReference.reference_of_spec uri (NReference.Ind (inductive,i,leftno))
514 i+1,(name,nref)::res)
518 (fun (name,_,ty,cl) ->
521 (interpretate_term ~obj_context:[] ~context ~env ~uri:None
522 ~is_path:false ty) in
528 (interpretate_term ~obj_context ~context ~env ~uri:None
529 ~is_path:false ty) in
530 let relevance = [] in
533 let relevance = [] in
534 relevance,name,ty',cl'
537 let height = (* XXX calculate *) 0 in
538 let attrs = `Provided, `Regular in
540 NCic.Inductive (inductive,leftno,tyl,attrs)
541 | NotationPt.Record (params,name,ty,fields) ->
545 (fun (context,res) (name,t) ->
548 None -> NotationPt.Implicit `JustOne
550 let name = cic_name_of_name name in
552 interpretate_term ~obj_context:[] ~context ~env ~uri:None
555 (name,NCic.Decl t)::context,(name,t)::res
558 context,List.rev res in
560 List.fold_right (fun (name,ty) t -> NCic.Prod (name,ty,t)) params in
561 let leftno = List.length params in
564 (interpretate_term ~obj_context:[] ~context ~env ~uri:None
565 ~is_path:false ty) in
567 NReference.reference_of_spec uri (NReference.Ind (true,0,leftno)) in
568 let obj_context = [name,nref] in
572 (fun (context,res) (name,ty,_coercion,_arity) ->
574 interpretate_term ~obj_context ~context ~env ~uri:None
576 let context' = (name,NCic.Decl ty)::context in
577 context',(name,ty)::res
578 ) (context,[]) fields) in
580 let mutind = NCic.Const nref in
581 if params = [] then mutind
584 (mutind::mk_rels (List.length params) (List.length fields)) in
586 List.fold_left (fun t (name,ty) -> NCic.Prod (name,ty,t)) concl fields' in
587 let con' = add_params con in
588 let relevance = [] in
589 let tyl = [relevance,name,ty',[relevance,"mk_" ^ name,con']] in
590 let field_names = List.map (fun (x,_,y,z) -> x,y,z) fields in
591 let height = (* XXX calculate *) 0 in
592 let attrs = `Provided, `Record field_names in
594 NCic.Inductive (true,leftno,tyl,attrs)
597 let disambiguate_term ~context ~metasenv ~subst ~expty
598 ~mk_implicit ~description_of_alias ~fix_instance ~mk_choice
599 ~aliases ~universe ~rdb ~lookup_in_library
600 (text,prefix_len,term)
602 let mk_localization_tbl x = NCicUntrusted.NCicHash.create x in
604 MultiPassDisambiguator.disambiguate_thing
605 ~freshen_thing:NotationUtil.freshen_term
606 ~context ~metasenv ~initial_ugraph:() ~aliases
607 ~mk_implicit ~description_of_alias ~fix_instance
608 ~string_context_of_context:(List.map (fun (x,_) -> Some x))
609 ~universe ~uri:None ~pp_thing:NotationPp.pp_term
610 ~passes:(MultiPassDisambiguator.passes ())
611 ~lookup_in_library ~domain_of_thing:Disambiguate.domain_of_term
612 ~interpretate_thing:(interpretate_term ~obj_context:[] ~mk_choice (?create_dummy_ids:None))
613 ~refine_thing:(refine_term ~rdb) (text,prefix_len,term)
614 ~mk_localization_tbl ~expty ~subst
616 List.map (function (a,b,c,d,_) -> a,b,c,d) res, b
620 ~mk_implicit ~description_of_alias ~fix_instance ~mk_choice
621 ~aliases ~universe ~rdb ~lookup_in_library ~uri
622 (text,prefix_len,obj)
624 let mk_localization_tbl x = NCicUntrusted.NCicHash.create x in
626 MultiPassDisambiguator.disambiguate_thing
627 ~freshen_thing:NotationUtil.freshen_obj
628 ~context:[] ~metasenv:[] ~subst:[] ~initial_ugraph:() ~aliases
629 ~mk_implicit ~description_of_alias ~fix_instance
630 ~string_context_of_context:(List.map (fun (x,_) -> Some x))
633 ~pp_thing:(NotationPp.pp_obj NotationPp.pp_term)
634 ~passes:(MultiPassDisambiguator.passes ())
635 ~lookup_in_library ~domain_of_thing:Disambiguate.domain_of_obj
636 ~interpretate_thing:(interpretate_obj ~mk_choice)
637 ~refine_thing:(refine_obj ~rdb)
638 (text,prefix_len,obj)
639 ~mk_localization_tbl ~expty:None
641 List.map (function (a,b,c,d,_) -> a,b,c,d) res, b
647 [false, NUri.uri_of_string ("cic:/matita/pts/Type.univ")]
649 [false, NUri.uri_of_string ("cic:/matita/pts/Type"^string_of_int n^".univ")]
653 [false, NUri.uri_of_string ("cic:/matita/pts/CProp.univ")]
655 [false, NUri.uri_of_string ("cic:/matita/pts/CProp"^string_of_int n^".univ")]
657 NCicEnvironment.add_constraint true (mk_type 0) (mk_type 1);
658 NCicEnvironment.add_constraint true (mk_cprop 0) (mk_cprop 1);
659 NCicEnvironment.add_constraint true (mk_cprop 0) (mk_type 1);
660 NCicEnvironment.add_constraint true (mk_type 0) (mk_cprop 1);
661 NCicEnvironment.add_constraint false (mk_cprop 0) (mk_type 0);
662 NCicEnvironment.add_constraint false (mk_type 0) (mk_cprop 0);
664 NCicEnvironment.add_constraint true (mk_type 1) (mk_type 2);
665 NCicEnvironment.add_constraint true (mk_cprop 1) (mk_cprop 2);
666 NCicEnvironment.add_constraint true (mk_cprop 1) (mk_type 2);
667 NCicEnvironment.add_constraint true (mk_type 1) (mk_cprop 2);
668 NCicEnvironment.add_constraint false (mk_cprop 1) (mk_type 1);
669 NCicEnvironment.add_constraint false (mk_type 1) (mk_cprop 1);
671 NCicEnvironment.add_constraint true (mk_type 2) (mk_type 3);
672 NCicEnvironment.add_constraint true (mk_cprop 2) (mk_cprop 3);
673 NCicEnvironment.add_constraint true (mk_cprop 2) (mk_type 3);
674 NCicEnvironment.add_constraint true (mk_type 2) (mk_cprop 3);
675 NCicEnvironment.add_constraint false (mk_cprop 2) (mk_type 2);
676 NCicEnvironment.add_constraint false (mk_type 2) (mk_cprop 2);
678 NCicEnvironment.add_constraint false (mk_cprop 3) (mk_type 3);
679 NCicEnvironment.add_constraint false (mk_type 3) (mk_cprop 3);