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
19 module Ast = CicNotationPt
20 module NRef = NReference
22 let debug_print _ = ();;
23 (* let debug_print s = prerr_endline (Lazy.force s);; *)
25 let cic_name_of_name = function
26 | Ast.Ident (n, None) -> n
30 let rec mk_rels howmany from =
33 | _ -> (NCic.Rel (howmany + from)) :: (mk_rels (howmany-1) from)
37 metasenv subst context uri ~coercion_db ~use_coercions term expty _ ~localization_tbl=
39 debug_print (lazy (sprintf "TEST_INTERPRETATION: %s"
40 (NCicPp.ppterm ~metasenv ~subst ~context term)));
43 try NCicUntrusted.NCicHash.find localization_tbl t
45 prerr_endline ("NOT LOCALISED" ^ NCicPp.ppterm ~metasenv ~subst ~context t);
46 (*assert false*) HExtlib.dummy_floc
48 let metasenv, subst, term, _ =
53 NCicCoercion.look_for_coercion coercion_db
54 else (fun _ _ _ _ _ -> []))
55 metasenv subst context term expty ~localise
57 Disambiguate.Ok (term, metasenv, subst, ())
59 | NCicRefiner.Uncertain loc_msg ->
60 debug_print (lazy ("UNCERTAIN: [" ^ snd (Lazy.force loc_msg) ^ "] " ^
61 NCicPp.ppterm ~metasenv ~subst ~context term)) ;
62 Disambiguate.Uncertain loc_msg
63 | NCicRefiner.RefineFailure loc_msg ->
64 debug_print (lazy (sprintf "PRUNED:\nterm%s\nmessage:%s"
65 (NCicPp.ppterm ~metasenv ~subst ~context term) (snd(Lazy.force loc_msg))));
66 Disambiguate.Ko loc_msg
70 ~coercion_db metasenv subst context _uri
71 ~use_coercions obj _ _ugraph ~localization_tbl
76 try NCicUntrusted.NCicHash.find localization_tbl t
78 prerr_endline (NCicPp.ppterm ~metasenv ~subst ~context t);
79 (*assert false*)HExtlib.dummy_floc
83 NCicRefiner.typeof_obj
87 NCicCoercion.look_for_coercion coercion_db
88 else (fun _ _ _ _ _ -> []))
91 Disambiguate.Ok (obj, [], [], ())
93 | NCicRefiner.Uncertain loc_msg ->
94 debug_print (lazy ("UNCERTAIN: [" ^ snd (Lazy.force loc_msg) ^ "] " ^
96 Disambiguate.Uncertain loc_msg
97 | NCicRefiner.RefineFailure loc_msg ->
98 debug_print (lazy (sprintf "PRUNED:\nobj: %s\nmessage: %s"
99 (NCicPp.ppobj obj) (snd(Lazy.force loc_msg))));
100 Disambiguate.Ko loc_msg
104 (* TODO move it to Cic *)
105 let find_in_context name context =
106 let rec aux acc = function
107 | [] -> raise Not_found
108 | hd :: _ when hd = name -> acc
109 | _ :: tl -> aux (acc + 1) tl
113 let interpretate_term_and_interpretate_term_option
114 ?(create_dummy_ids=false)
115 ~obj_context ~mk_choice ~env ~uri ~is_path ~localization_tbl
117 (* create_dummy_ids shouldbe used only for interpretating patterns *)
120 let rec aux ~localize loc context = function
121 | CicNotationPt.AttributedTerm (`Loc loc, term) ->
122 let res = aux ~localize loc context term in
124 NCicUntrusted.NCicHash.add localization_tbl res loc;
126 | CicNotationPt.AttributedTerm (_, term) -> aux ~localize loc context term
127 | CicNotationPt.Appl (CicNotationPt.Symbol (symb, i) :: args) ->
128 let cic_args = List.map (aux ~localize loc context) args in
129 Disambiguate.resolve ~mk_choice ~env (Symbol (symb, i)) (`Args cic_args)
130 | CicNotationPt.Appl terms ->
131 NCic.Appl (List.map (aux ~localize loc context) terms)
132 | CicNotationPt.Binder (binder_kind, (var, typ), body) ->
133 let cic_type = aux_option ~localize loc context `Type typ in
134 let cic_name = cic_name_of_name var in
135 let cic_body = aux ~localize loc (cic_name :: context) body in
136 (match binder_kind with
137 | `Lambda -> NCic.Lambda (cic_name, cic_type, cic_body)
139 | `Forall -> NCic.Prod (cic_name, cic_type, cic_body)
141 Disambiguate.resolve ~env ~mk_choice (Symbol ("exists", 0))
142 (`Args [ cic_type; NCic.Lambda (cic_name, cic_type, cic_body) ]))
143 | CicNotationPt.Case (term, indty_ident, outtype, branches) ->
144 let cic_term = aux ~localize loc context term in
145 let cic_outtype = aux_option ~localize loc context `Term outtype in
146 let do_branch ((_, _, args), term) =
147 let rec do_branch' context = function
148 | [] -> aux ~localize loc context term
149 | (name, typ) :: tl ->
150 let cic_name = cic_name_of_name name in
151 let cic_body = do_branch' (cic_name :: context) tl in
154 | None -> NCic.Implicit `Type
155 | Some typ -> aux ~localize loc context typ
157 NCic.Lambda (cic_name, typ, cic_body)
159 do_branch' context args
161 if create_dummy_ids then
165 Ast.Wildcard,term -> ("wildcard",None,[]), term
167 raise (DisambiguateTypes.Invalid_choice
168 (lazy (loc, "Syntax error: the left hand side of a "^
169 "branch pattern must be \"_\"")))
173 NCic.MutCase (ref, cic_outtype, cic_term,
174 (List.map do_branch branches))
175 *) ignore branches; assert false (* patterns not implemented yet *)
178 match indty_ident with
179 | Some (indty_ident, _) ->
180 (match Disambiguate.resolve ~env ~mk_choice
181 (Id indty_ident) (`Args []) with
182 | NCic.Const (NReference.Ref (_,NReference.Ind _) as r) -> r
184 raise (Disambiguate.Try_again
185 (lazy "The type of the term to be matched is still unknown"))
187 raise (DisambiguateTypes.Invalid_choice
188 (lazy (loc,"The type of the term to be matched "^
189 "is not (co)inductive: " ^ NCicPp.ppterm
190 ~metasenv:[] ~subst:[] ~context:[] t))))
192 let rec fst_constructor =
194 (Ast.Pattern (head, _, _), _) :: _ -> head
195 | (Ast.Wildcard, _) :: tl -> fst_constructor tl
196 | [] -> raise (Invalid_choice (lazy (loc,"The type "^
197 "of the term to be matched cannot be determined "^
198 "because it is an inductive type without constructors "^
199 "or because all patterns use wildcards")))
202 DisambiguateTypes.Environment.iter
205 (DisambiguateTypes.string_of_domain_item k ^ " => " ^
206 description_of_alias v)) env;
208 (match Disambiguate.resolve ~env ~mk_choice
209 (Id (fst_constructor branches)) (`Args []) with
210 | NCic.Const (NReference.Ref (_,NReference.Con _) as r) ->
211 let b,_,_,_,_ = NCicEnvironment.get_checked_indtys r in
212 NReference.mk_indty b r
214 raise (Disambiguate.Try_again
215 (lazy "The type of the term to be matched is still unknown"))
217 raise (DisambiguateTypes.Invalid_choice
219 "The type of the term to be matched is not (co)inductive: "
220 ^ NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] t))))
222 let _,leftsno,itl,_,indtyp_no =
223 NCicEnvironment.get_checked_indtys indtype_ref in
226 List.nth itl indtyp_no
227 with _ -> assert false in
228 let rec count_prod t =
229 match NCicReduction.whd ~subst:[] [] t with
230 NCic.Prod (_, _, t) -> 1 + (count_prod t)
233 let rec sort branches cl =
236 let rec analyze unused unrecognized useless =
239 if unrecognized != [] then
240 raise (DisambiguateTypes.Invalid_choice
242 (loc,"Unrecognized constructors: " ^
243 String.concat " " unrecognized)))
244 else if useless > 0 then
245 raise (DisambiguateTypes.Invalid_choice
247 (loc,"The last " ^ string_of_int useless ^
248 "case" ^ if useless > 1 then "s are" else " is" ^
252 | (Ast.Wildcard,_)::tl when not unused ->
253 analyze true unrecognized useless tl
254 | (Ast.Pattern (head,_,_),_)::tl when not unused ->
255 analyze unused (head::unrecognized) useless tl
256 | _::tl -> analyze unused unrecognized (useless + 1) tl
258 analyze false [] 0 branches
259 | (_,name,ty)::cltl ->
260 let rec find_and_remove =
264 (DisambiguateTypes.Invalid_choice
265 (lazy (loc, "Missing case: " ^ name)))
266 | ((Ast.Wildcard, _) as branch :: _) as branches ->
268 | (Ast.Pattern (name',_,_),_) as branch :: tl
272 let found,rest = find_and_remove tl in
275 let branch,tl = find_and_remove branches in
277 Ast.Pattern (name,y,args),term ->
278 if List.length args = count_prod ty - leftsno then
279 ((name,y,args),term)::sort tl cltl
282 (DisambiguateTypes.Invalid_choice
283 (lazy (loc,"Wrong number of arguments for " ^ name)))
284 | Ast.Wildcard,term ->
290 (`Lambda, (CicNotationPt.Ident ("_", None), None),
293 (("wildcard",None,[]),
294 mk_lambdas (count_prod ty - leftsno)) :: sort tl cltl
296 let branches = sort branches cl in
297 NCic.Match (indtype_ref, cic_outtype, cic_term,
298 (List.map do_branch branches))
299 | CicNotationPt.Cast (t1, t2) ->
300 let cic_t1 = aux ~localize loc context t1 in
301 let cic_t2 = aux ~localize loc context t2 in
302 NCic.LetIn ("_",cic_t2,cic_t1, NCic.Rel 1)
303 | CicNotationPt.LetIn ((name, typ), def, body) ->
304 let cic_def = aux ~localize loc context def in
305 let cic_name = cic_name_of_name name in
308 | None -> NCic.Implicit `Type
309 | Some t -> aux ~localize loc context t
311 let cic_body = aux ~localize loc (cic_name :: context) body in
312 NCic.LetIn (cic_name, cic_typ, cic_def, cic_body)
313 | CicNotationPt.LetRec (_kind, _defs, _body) -> NCic.Implicit `Term
314 | CicNotationPt.Ident _
315 | CicNotationPt.Uri _
316 | CicNotationPt.NRef _ when is_path -> raise Disambiguate.PathNotWellFormed
317 | CicNotationPt.Ident (name, subst) ->
318 assert (subst = None);
320 NCic.Rel (find_in_context name context)
322 try NCic.Const (List.assoc name obj_context)
324 Disambiguate.resolve ~env ~mk_choice (Id name) (`Args []))
325 | CicNotationPt.Uri (uri, subst) ->
326 assert (subst = None);
328 NCic.Const (OCic2NCic.reference_of_oxuri(UriManager.uri_of_string uri))
329 with NRef.IllFormedReference _ ->
330 CicNotationPt.fail loc "Ill formed reference")
331 | CicNotationPt.NRef nref -> NCic.Const nref
332 | CicNotationPt.Implicit -> NCic.Implicit `Term
333 | CicNotationPt.UserInput -> NCic.Implicit `Hole
334 | CicNotationPt.Num (num, i) ->
335 Disambiguate.resolve ~env ~mk_choice (Num i) (`Num_arg num)
336 | CicNotationPt.Meta (index, subst) ->
339 (function None -> assert false| Some t -> aux ~localize loc context t)
342 NCic.Meta (index, (0, NCic.Ctx cic_subst))
343 | CicNotationPt.Sort `Prop -> NCic.Sort NCic.Prop
344 | CicNotationPt.Sort `Set -> NCic.Sort (NCic.Type
345 [false,NUri.uri_of_string "cic:/matita/pts/Type.univ"])
346 | CicNotationPt.Sort (`Type _u) -> NCic.Sort (NCic.Type
347 [false,NUri.uri_of_string "cic:/matita/pts/Type0.univ"])
348 | CicNotationPt.Sort (`NType s) -> NCic.Sort (NCic.Type
349 [false,NUri.uri_of_string ("cic:/matita/pts/Type" ^ s ^ ".univ")])
350 | CicNotationPt.Sort (`NCProp s) -> NCic.Sort (NCic.Type
351 [false,NUri.uri_of_string ("cic:/matita/pts/CProp" ^ s ^ ".univ")])
352 | CicNotationPt.Sort (`CProp _u) -> NCic.Sort (NCic.Type
353 [false,NUri.uri_of_string "cic:/matita/pts/CProp0.univ"])
354 | CicNotationPt.Symbol (symbol, instance) ->
355 Disambiguate.resolve ~env ~mk_choice
356 (Symbol (symbol, instance)) (`Args [])
357 | CicNotationPt.Variable _
358 | CicNotationPt.Magic _
359 | CicNotationPt.Layout _
360 | CicNotationPt.Literal _ -> assert false (* god bless Bologna *)
361 and aux_option ~localize loc context annotation = function
362 | None -> NCic.Implicit annotation
363 | Some (CicNotationPt.AttributedTerm (`Loc loc, term)) ->
364 let res = aux_option ~localize loc context annotation (Some term) in
366 NCicUntrusted.NCicHash.add localization_tbl res loc;
368 | Some (CicNotationPt.AttributedTerm (_, term)) ->
369 aux_option ~localize loc context annotation (Some term)
370 | Some CicNotationPt.Implicit -> NCic.Implicit annotation
371 | Some term -> aux ~localize loc context term
373 (fun ~context -> aux ~localize:true HExtlib.dummy_floc context),
374 (fun ~context -> aux_option ~localize:true HExtlib.dummy_floc context)
377 let interpretate_term ?(create_dummy_ids=false) ~context ~env ~uri ~is_path ast
378 ~obj_context ~localization_tbl ~mk_choice
380 let context = List.map fst context in
382 (interpretate_term_and_interpretate_term_option
383 ~obj_context ~mk_choice ~create_dummy_ids ~env ~uri ~is_path ~localization_tbl)
387 let interpretate_term_option
388 ?(create_dummy_ids=false) ~context ~env ~uri ~is_path
389 ~localization_tbl ~mk_choice ~obj_context
391 let context = List.map fst context in
393 (interpretate_term_and_interpretate_term_option
394 ~obj_context ~mk_choice ~create_dummy_ids ~env ~uri ~is_path ~localization_tbl)
398 let disambiguate_path path =
399 let localization_tbl = NCicUntrusted.NCicHash.create 23 in
401 (interpretate_term_and_interpretate_term_option
402 ~obj_context:[] ~mk_choice:(fun _ -> assert false)
403 ~create_dummy_ids:true ~env:DisambiguateTypes.Environment.empty
404 ~uri:None ~is_path:true ~localization_tbl) ~context:[] path
407 let new_flavour_of_flavour = function
408 | `Definition -> `Definition
409 | `MutualDefinition -> `Definition
412 | `Remark -> `Corollary
413 | `Theorem -> `Theorem
414 | `Variant -> `Corollary
418 let ncic_name_of_ident = function
419 | Ast.Ident (name, None) -> name
424 (* ?(create_dummy_ids=false) *)
425 ~context ~env ~uri ~is_path obj ~localization_tbl ~mk_choice
427 assert (context = []);
428 assert (is_path = false);
429 let interpretate_term ~obj_context =
430 interpretate_term ~mk_choice ~localization_tbl ~obj_context in
431 let interpretate_term_option ~obj_context =
432 interpretate_term_option ~mk_choice ~localization_tbl ~obj_context in
433 let uri = match uri with | None -> assert false | Some u -> u in
435 | CicNotationPt.Theorem (flavour, name, ty, bo) ->
438 ~obj_context:[] ~context:[] ~env ~uri:None ~is_path:false ty
440 let height = (* XXX calculate *) 0 in
442 (match bo,flavour with
444 let attrs = `Provided, new_flavour_of_flavour flavour, `Regular in
445 NCic.Constant ([],name,None,ty',attrs)
446 | Some _,`Axiom -> assert false
448 let attrs = `Provided, new_flavour_of_flavour flavour, `Regular in
449 NCic.Constant ([],name,Some (NCic.Implicit `Term),ty',attrs)
452 | CicNotationPt.LetRec (kind, defs, _) ->
453 let inductive = kind = `Inductive in
456 (fun (i,acc) (_,(name,_),_,k) ->
458 (ncic_name_of_ident name, NReference.reference_of_spec uri
459 (if inductive then NReference.Fix (i,k,0)
460 else NReference.CoFix i)) :: acc))
465 (fun (params, (name, typ), body, decr_idx) ->
466 let add_binders kind t =
469 CicNotationPt.Binder (kind, var, t)) params t
473 ~obj_context ~context ~env ~uri:None ~is_path:false
474 (add_binders `Lambda body)
477 interpretate_term_option
479 ~context ~env ~uri:None ~is_path:false `Type
480 (HExtlib.map_option (add_binders `Pi) typ)
482 ([],ncic_name_of_ident name, decr_idx, cic_type, cic_body))
485 let attrs = `Provided, new_flavour_of_flavour flavour in
486 NCic.Fixpoint (inductive,inductiveFuns,attrs)
490 ~obj_context:[] ~context:[] ~env ~uri:None ~is_path:false bo
492 let attrs = `Provided, new_flavour_of_flavour flavour, `Regular in
493 NCic.Constant ([],name,Some bo,ty',attrs)))
494 | CicNotationPt.Inductive (params,tyl) ->
498 (fun (context,res) (name,t) ->
501 None -> CicNotationPt.Implicit
503 let name = cic_name_of_name name in
505 interpretate_term ~obj_context:[] ~context ~env ~uri:None
508 (name,NCic.Decl t)::context,(name,t)::res
511 context,List.rev res in
513 List.fold_right (fun (name,ty) t -> NCic.Prod (name,ty,t)) params in
514 let leftno = List.length params in
518 (fun (i,res) (name,_,_,_) ->
519 let _,inductive,_,_ =
521 try List.hd tyl with Failure _ -> assert false in
523 NReference.reference_of_spec uri (NReference.Ind (inductive,i,leftno))
525 i+1,(name,nref)::res)
529 (fun (name,_,ty,cl) ->
532 (interpretate_term ~obj_context:[] ~context ~env ~uri:None
533 ~is_path:false ty) in
539 (interpretate_term ~obj_context ~context ~env ~uri:None
540 ~is_path:false ty) in
541 let relevance = [] in
544 let relevance = [] in
545 relevance,name,ty',cl'
548 let height = (* XXX calculate *) 0 in
549 let attrs = `Provided, `Regular in
551 NCic.Inductive (true,leftno,tyl,attrs)
552 | CicNotationPt.Record (params,name,ty,fields) ->
556 (fun (context,res) (name,t) ->
559 None -> CicNotationPt.Implicit
561 let name = cic_name_of_name name in
563 interpretate_term ~obj_context:[] ~context ~env ~uri:None
566 (name,NCic.Decl t)::context,(name,t)::res
569 context,List.rev res in
571 List.fold_right (fun (name,ty) t -> NCic.Prod (name,ty,t)) params in
572 let leftno = List.length params in
575 (interpretate_term ~obj_context:[] ~context ~env ~uri:None
576 ~is_path:false ty) in
578 NReference.reference_of_spec uri (NReference.Ind (true,0,leftno)) in
579 let obj_context = [name,nref] in
583 (fun (context,res) (name,ty,_coercion,_arity) ->
585 interpretate_term ~obj_context ~context ~env ~uri:None
587 let context' = (name,NCic.Decl ty)::context in
588 context',(name,ty)::res
589 ) (context,[]) fields) in
591 let mutind = NCic.Const nref in
592 if params = [] then mutind
595 (mutind::mk_rels (List.length params) (List.length fields)) in
597 List.fold_left (fun t (name,ty) -> NCic.Prod (name,ty,t)) concl fields' in
598 let con' = add_params con in
599 let relevance = [] in
600 let tyl = [relevance,name,ty',[relevance,"mk_" ^ name,con']] in
601 let field_names = List.map (fun (x,_,y,z) -> x,y,z) fields in
602 let height = (* XXX calculate *) 0 in
603 let attrs = `Provided, `Record field_names in
605 NCic.Inductive (true,leftno,tyl,attrs)
608 let disambiguate_term ~context ~metasenv ~subst ~expty
609 ~mk_implicit ~description_of_alias ~mk_choice
610 ~aliases ~universe ~coercion_db ~lookup_in_library
611 (text,prefix_len,term)
613 let mk_localization_tbl x = NCicUntrusted.NCicHash.create x in
615 MultiPassDisambiguator.disambiguate_thing
616 ~freshen_thing:CicNotationUtil.freshen_term
617 ~context ~metasenv ~initial_ugraph:() ~aliases
618 ~mk_implicit ~description_of_alias
619 ~string_context_of_context:(List.map (fun (x,_) -> Some x))
620 ~universe ~uri:None ~pp_thing:CicNotationPp.pp_term
621 ~passes:(MultiPassDisambiguator.passes ())
622 ~lookup_in_library ~domain_of_thing:Disambiguate.domain_of_term
623 ~interpretate_thing:(interpretate_term ~obj_context:[] ~mk_choice (?create_dummy_ids:None))
624 ~refine_thing:(refine_term ~coercion_db) (text,prefix_len,term)
625 ~mk_localization_tbl ~expty ~subst
627 List.map (function (a,b,c,d,_) -> a,b,c,d) res, b
631 ~mk_implicit ~description_of_alias ~mk_choice
632 ~aliases ~universe ~coercion_db ~lookup_in_library ~uri
633 (text,prefix_len,obj)
635 let mk_localization_tbl x = NCicUntrusted.NCicHash.create x in
637 MultiPassDisambiguator.disambiguate_thing
638 ~freshen_thing:CicNotationUtil.freshen_obj
639 ~context:[] ~metasenv:[] ~subst:[] ~initial_ugraph:() ~aliases
640 ~mk_implicit ~description_of_alias
641 ~string_context_of_context:(List.map (fun (x,_) -> Some x))
644 ~pp_thing:(CicNotationPp.pp_obj CicNotationPp.pp_term)
645 ~passes:(MultiPassDisambiguator.passes ())
646 ~lookup_in_library ~domain_of_thing:Disambiguate.domain_of_obj
647 ~interpretate_thing:(interpretate_obj ~mk_choice)
648 ~refine_thing:(refine_obj ~coercion_db)
649 (text,prefix_len,obj)
650 ~mk_localization_tbl ~expty:None
652 List.map (function (a,b,c,d,_) -> a,b,c,d) res, b
658 [false, NUri.uri_of_string ("cic:/matita/pts/Type.univ")]
660 [false, NUri.uri_of_string ("cic:/matita/pts/Type"^string_of_int n^".univ")]
664 [false, NUri.uri_of_string ("cic:/matita/pts/CProp.univ")]
666 [false, NUri.uri_of_string ("cic:/matita/pts/CProp"^string_of_int n^".univ")]
668 NCicEnvironment.add_constraint true (mk_type 0) (mk_type 1);
669 NCicEnvironment.add_constraint true (mk_cprop 0) (mk_cprop 1);
670 NCicEnvironment.add_constraint true (mk_cprop 0) (mk_type 1);
671 NCicEnvironment.add_constraint true (mk_type 0) (mk_cprop 1);
672 NCicEnvironment.add_constraint false (mk_cprop 0) (mk_type 0);
673 NCicEnvironment.add_constraint false (mk_type 0) (mk_cprop 0);
675 NCicEnvironment.add_constraint true (mk_type 1) (mk_type 2);
676 NCicEnvironment.add_constraint true (mk_cprop 1) (mk_cprop 2);
677 NCicEnvironment.add_constraint true (mk_cprop 1) (mk_type 2);
678 NCicEnvironment.add_constraint true (mk_type 1) (mk_cprop 2);
679 NCicEnvironment.add_constraint false (mk_cprop 1) (mk_type 1);
680 NCicEnvironment.add_constraint false (mk_type 1) (mk_cprop 1);
682 NCicEnvironment.add_constraint true (mk_type 2) (mk_type 3);
683 NCicEnvironment.add_constraint true (mk_cprop 2) (mk_cprop 3);
684 NCicEnvironment.add_constraint true (mk_cprop 2) (mk_type 3);
685 NCicEnvironment.add_constraint true (mk_type 2) (mk_cprop 3);
686 NCicEnvironment.add_constraint false (mk_cprop 2) (mk_type 2);
687 NCicEnvironment.add_constraint false (mk_type 2) (mk_cprop 2);
689 NCicEnvironment.add_constraint false (mk_cprop 3) (mk_type 3);
690 NCicEnvironment.add_constraint false (mk_type 3) (mk_cprop 3);