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 $ *)
15 module DT = DisambiguateTypes
16 module Ast = NotationPt
17 module NRef = NReference
19 let debug = ref false;;
20 let debug_print s = if !debug then prerr_endline (Lazy.force s);;
22 let cic_name_of_name = function
23 | Ast.Ident (n, None) -> n
27 let rec mk_rels howmany from =
30 | _ -> (NCic.Rel (howmany + from)) :: (mk_rels (howmany-1) from)
33 let refine_term (status: #NCicCoercion.status) metasenv subst context uri ~use_coercions term expty _
37 debug_print (lazy (P.sprintf "TEST_INTERPRETATION: %s"
38 (status#ppterm ~metasenv ~subst ~context term)));
41 try NCicUntrusted.NCicHash.find localization_tbl t
43 prerr_endline ("NOT LOCALISED" ^ status#ppterm ~metasenv ~subst ~context t);
44 (*assert false*) HExtlib.dummy_floc
46 let metasenv, subst, term, _ =
49 (if use_coercions then status#coerc_db else NCicCoercion.empty_db))
50 metasenv subst context term expty ~localise
52 Disambiguate.Ok (term, metasenv, subst, ())
54 | NCicRefiner.Uncertain loc_msg ->
55 debug_print (lazy ("UNCERTAIN: [" ^ snd (Lazy.force loc_msg) ^ "] " ^
56 status#ppterm ~metasenv ~subst ~context term)) ;
57 Disambiguate.Uncertain loc_msg
58 | NCicRefiner.RefineFailure loc_msg ->
59 debug_print (lazy (P.sprintf "PRUNED:\nterm%s\nmessage:%s"
60 (status#ppterm ~metasenv ~subst ~context term) (snd(Lazy.force loc_msg))));
61 Disambiguate.Ko loc_msg
64 let refine_obj status metasenv subst _context _uri ~use_coercions obj _ _ugraph
67 (*prerr_endline ((P.sprintf "TEST_INTERPRETATION: %s" (status#ppobj obj)));*)
71 try NCicUntrusted.NCicHash.find localization_tbl t
73 (*assert false*)HExtlib.dummy_floc
77 NCicRefiner.typeof_obj
79 (if use_coercions then status#coerc_db
80 else NCicCoercion.empty_db))
83 Disambiguate.Ok (obj, [], [], ())
85 | NCicRefiner.Uncertain loc_msg ->
86 debug_print (lazy ("UNCERTAIN: [" ^ snd (Lazy.force loc_msg) ^ "] " ^
88 Disambiguate.Uncertain loc_msg
89 | NCicRefiner.RefineFailure loc_msg ->
90 debug_print (lazy (P.sprintf "PRUNED:\nobj: %s\nmessage: %s"
91 (status#ppobj obj) (snd(Lazy.force loc_msg))));
92 Disambiguate.Ko loc_msg
96 (* TODO move it to Cic *)
97 let find_in_context name context =
98 let rec aux acc = function
99 | [] -> raise Not_found
100 | hd :: _ when hd = name -> acc
101 | _ :: tl -> aux (acc + 1) tl
105 let interpretate_term_and_interpretate_term_option (status: #NCic.status)
106 ?(create_dummy_ids=false) ~obj_context ~mk_choice ~env ~uri ~is_path
109 (* create_dummy_ids shouldbe used only for interpretating patterns *)
112 let rec aux ~localize loc context = function
113 | NotationPt.AttributedTerm (`Loc loc, term) ->
114 let res = aux ~localize loc context term in
116 NCicUntrusted.NCicHash.add localization_tbl res loc;
118 | NotationPt.AttributedTerm (_, term) -> aux ~localize loc context term
120 (NotationPt.AttributedTerm (att, inner)::args)->
121 aux ~localize loc context
122 (NotationPt.AttributedTerm (att,NotationPt.Appl (inner :: args)))
123 | NotationPt.Appl (NotationPt.Appl inner :: args) ->
124 aux ~localize loc context (NotationPt.Appl (inner @ args))
125 | NotationPt.Appl (NotationPt.Symbol (symb, i) :: args) ->
126 let cic_args = List.map (aux ~localize loc context) args in
127 Disambiguate.resolve ~mk_choice ~env (DT.Symbol (symb, i)) (`Args cic_args)
128 | NotationPt.Appl terms ->
129 NCic.Appl (List.map (aux ~localize loc context) terms)
130 | NotationPt.Binder (binder_kind, (var, typ), body) ->
131 let cic_type = aux_option ~localize loc context `Type typ in
132 let cic_name = cic_name_of_name var in
133 let cic_body = aux ~localize loc (cic_name :: context) body in
134 (match binder_kind with
135 | `Lambda -> NCic.Lambda (cic_name, cic_type, cic_body)
137 | `Forall -> NCic.Prod (cic_name, cic_type, cic_body)
139 Disambiguate.resolve ~env ~mk_choice (DT.Symbol ("exists", 0))
140 (`Args [ cic_type; NCic.Lambda (cic_name, cic_type, cic_body) ]))
141 | NotationPt.Case (term, indty_ident, outtype, branches) ->
142 let cic_term = aux ~localize loc context term in
143 let cic_outtype = aux_option ~localize loc context `Term outtype in
144 let do_branch ((_, _, args), term) =
145 let rec do_branch' context = function
146 | [] -> aux ~localize loc context term
147 | (name, typ) :: tl ->
148 let cic_name = cic_name_of_name name in
149 let cic_body = do_branch' (cic_name :: context) tl in
152 | None -> NCic.Implicit `Type
153 | Some typ -> aux ~localize loc context typ
155 NCic.Lambda (cic_name, typ, cic_body)
157 do_branch' context args
159 if create_dummy_ids then
163 Ast.Wildcard,term -> ("wildcard",None,[]), term
165 raise (DisambiguateTypes.Invalid_choice
166 (lazy (loc, "Syntax error: the left hand side of a "^
167 "branch pattern must be \"_\"")))
170 NReference.reference_of_string "cic:/fake_indty.ind(0,0,0)"
172 NCic.Match (indtype_ref, cic_outtype, cic_term,
173 (List.map do_branch branches))
176 match indty_ident with
177 | Some (indty_ident, _) ->
178 (match Disambiguate.resolve ~env ~mk_choice
179 (DT.Id indty_ident) (`Args []) with
180 | NCic.Const (NReference.Ref (_,NReference.Ind _) as r) -> r
182 raise (Disambiguate.Try_again
183 (lazy "The type of the term to be matched is still unknown"))
185 raise (DisambiguateTypes.Invalid_choice
186 (lazy (loc,"The type of the term to be matched "^
187 "is not (co)inductive: " ^ status#ppterm
188 ~metasenv:[] ~subst:[] ~context:[] t))))
190 let rec fst_constructor =
192 (Ast.Pattern (head, _, _), _) :: _ -> head
193 | (Ast.Wildcard, _) :: tl -> fst_constructor tl
194 | [] -> raise (DT.Invalid_choice (lazy (loc,"The type "^
195 "of the term to be matched cannot be determined "^
196 "because it is an inductive type without constructors "^
197 "or because all patterns use wildcards")))
200 DisambiguateTypes.Environment.iter
203 (DisambiguateTypes.string_of_domain_item k ^ " => " ^
204 description_of_alias v)) env;
206 (match Disambiguate.resolve ~env ~mk_choice
207 (DT.Id (fst_constructor branches)) (`Args []) with
208 | NCic.Const (NReference.Ref (_,NReference.Con _) as r) ->
209 let b,_,_,_,_= NCicEnvironment.get_checked_indtys status r in
210 NReference.mk_indty b r
212 raise (Disambiguate.Try_again
213 (lazy "The type of the term to be matched is still unknown"))
215 raise (DisambiguateTypes.Invalid_choice
217 "The type of the term to be matched is not (co)inductive: "
218 ^ status#ppterm ~metasenv:[] ~subst:[] ~context:[] t))))
220 let _,leftsno,itl,_,indtyp_no =
221 NCicEnvironment.get_checked_indtys status indtype_ref in
224 List.nth itl indtyp_no
225 with _ -> assert false in
226 let rec count_prod t =
227 match NCicReduction.whd status ~subst:[] [] t with
228 NCic.Prod (_, _, t) -> 1 + (count_prod t)
231 let rec sort branches cl =
234 let rec analyze unused unrecognized useless =
237 if unrecognized != [] then
238 raise (DisambiguateTypes.Invalid_choice
240 (loc,"Unrecognized constructors: " ^
241 String.concat " " unrecognized)))
242 else if useless > 0 then
243 raise (DisambiguateTypes.Invalid_choice
245 (loc,"The last " ^ string_of_int useless ^
246 "case" ^ if useless > 1 then "s are" else " is" ^
250 | (Ast.Wildcard,_)::tl when not unused ->
251 analyze true unrecognized useless tl
252 | (Ast.Pattern (head,_,_),_)::tl when not unused ->
253 analyze unused (head::unrecognized) useless tl
254 | _::tl -> analyze unused unrecognized (useless + 1) tl
256 analyze false [] 0 branches
257 | (_,name,ty)::cltl ->
258 let rec find_and_remove =
262 (DisambiguateTypes.Invalid_choice
263 (lazy (loc, "Missing case: " ^ name)))
264 | ((Ast.Wildcard, _) as branch :: _) as branches ->
266 | (Ast.Pattern (name',_,_),_) as branch :: tl
270 let found,rest = find_and_remove tl in
273 let branch,tl = find_and_remove branches in
275 Ast.Pattern (name,y,args),term ->
276 if List.length args = count_prod ty - leftsno then
277 ((name,y,args),term)::sort tl cltl
280 (DisambiguateTypes.Invalid_choice
281 (lazy (loc,"Wrong number of arguments for " ^ name)))
282 | Ast.Wildcard,term ->
288 (`Lambda, (NotationPt.Ident ("_", None), None),
291 (("wildcard",None,[]),
292 mk_lambdas (count_prod ty - leftsno)) :: sort tl cltl
294 let branches = sort branches cl in
295 NCic.Match (indtype_ref, cic_outtype, cic_term,
296 (List.map do_branch branches))
297 | NotationPt.Cast (t1, t2) ->
298 let cic_t1 = aux ~localize loc context t1 in
299 let cic_t2 = aux ~localize loc context t2 in
300 NCic.LetIn ("_",cic_t2,cic_t1, NCic.Rel 1)
301 | NotationPt.LetIn ((name, typ), def, body) ->
302 let cic_def = aux ~localize loc context def in
303 let cic_name = cic_name_of_name name in
306 | None -> NCic.Implicit `Type
307 | Some t -> aux ~localize loc context t
309 let cic_body = aux ~localize loc (cic_name :: context) body in
310 NCic.LetIn (cic_name, cic_typ, cic_def, cic_body)
311 | NotationPt.LetRec (_kind, _defs, _body) -> NCic.Implicit `Term
314 | NotationPt.NRef _ when is_path -> raise Disambiguate.PathNotWellFormed
315 | NotationPt.Ident (name, subst) ->
316 assert (subst = None);
318 NCic.Rel (find_in_context name context)
320 try NCic.Const (List.assoc name obj_context)
322 Disambiguate.resolve ~env ~mk_choice (DT.Id name) (`Args []))
323 | NotationPt.Uri (uri, subst) ->
324 assert (subst = None);
326 NCic.Const (NReference.reference_of_string uri)
327 with NRef.IllFormedReference _ ->
328 NotationPt.fail loc "Ill formed reference")
329 | NotationPt.NRef nref -> NCic.Const nref
330 | NotationPt.NCic t -> t
331 | NotationPt.Implicit `Vector -> NCic.Implicit `Vector
332 | NotationPt.Implicit `JustOne -> NCic.Implicit `Term
333 | NotationPt.Implicit (`Tagged s) -> NCic.Implicit (`Tagged s)
334 | NotationPt.UserInput -> NCic.Implicit `Hole
335 | NotationPt.Num (num, i) ->
336 Disambiguate.resolve ~env ~mk_choice (DT.Num i) (`Num_arg num)
337 | NotationPt.Meta (index, subst) ->
340 (function None -> assert false| Some t -> aux ~localize loc context t)
343 NCic.Meta (index, (0, NCic.Ctx cic_subst))
344 | NotationPt.Sort `Prop -> NCic.Sort NCic.Prop
345 | NotationPt.Sort `Set -> NCic.Sort (NCic.Type
346 [`Type,NUri.uri_of_string "cic:/matita/pts/Type.univ"])
347 | NotationPt.Sort (`NType s) -> NCic.Sort (NCic.Type
348 [`Type,NUri.uri_of_string ("cic:/matita/pts/Type" ^ s ^ ".univ")])
349 | NotationPt.Sort (`NCProp s) -> NCic.Sort (NCic.Type
350 [`CProp,NUri.uri_of_string ("cic:/matita/pts/Type" ^ s ^ ".univ")])
351 | NotationPt.Symbol (symbol, instance) ->
352 Disambiguate.resolve ~env ~mk_choice
353 (DT.Symbol (symbol, instance)) (`Args [])
354 | NotationPt.Variable _
356 | NotationPt.Layout _
357 | NotationPt.Literal _ -> assert false (* god bless Bologna *)
358 and aux_option ~localize loc context annotation = function
359 | None -> NCic.Implicit annotation
360 | Some (NotationPt.AttributedTerm (`Loc loc, term)) ->
361 let res = aux_option ~localize loc context annotation (Some term) in
363 NCicUntrusted.NCicHash.add localization_tbl res loc;
365 | Some (NotationPt.AttributedTerm (_, term)) ->
366 aux_option ~localize loc context annotation (Some term)
367 | Some NotationPt.Implicit `JustOne -> NCic.Implicit annotation
368 | Some NotationPt.Implicit `Vector -> NCic.Implicit `Vector
369 | Some term -> aux ~localize loc context term
371 (fun ~context -> aux ~localize:true HExtlib.dummy_floc context),
372 (fun ~context -> aux_option ~localize:true HExtlib.dummy_floc context)
375 let interpretate_term status ?(create_dummy_ids=false) ~context ~env ~uri
376 ~is_path ast ~obj_context ~localization_tbl ~mk_choice
378 let context = List.map fst context in
380 (interpretate_term_and_interpretate_term_option status
381 ~obj_context ~mk_choice ~create_dummy_ids ~env ~uri ~is_path
386 let interpretate_term_option status ?(create_dummy_ids=false) ~context ~env ~uri
387 ~is_path ~localization_tbl ~mk_choice ~obj_context
389 let context = List.map fst context in
391 (interpretate_term_and_interpretate_term_option status
392 ~obj_context ~mk_choice ~create_dummy_ids ~env ~uri ~is_path
397 let disambiguate_path status path =
398 let localization_tbl = NCicUntrusted.NCicHash.create 23 in
400 (interpretate_term_and_interpretate_term_option status
401 ~obj_context:[] ~mk_choice:(fun _ -> assert false)
402 ~create_dummy_ids:true ~env:DisambiguateTypes.Environment.empty
403 ~uri:None ~is_path:true ~localization_tbl) ~context:[] path
406 let ncic_name_of_ident = function
407 | Ast.Ident (name, None) -> name
411 let interpretate_obj status
412 (* ?(create_dummy_ids=false) *)
413 ~context ~env ~uri ~is_path obj ~localization_tbl ~mk_choice
415 assert (context = []);
416 assert (is_path = false);
417 let interpretate_term ~obj_context =
418 interpretate_term ~mk_choice ~localization_tbl ~obj_context in
419 let interpretate_term_option ~obj_context =
420 interpretate_term_option ~mk_choice ~localization_tbl ~obj_context in
421 let uri = match uri with | None -> assert false | Some u -> u in
423 | NotationPt.Theorem (name, ty, bo, attrs) ->
424 let _, flavour, _ = attrs in
426 interpretate_term status
427 ~obj_context:[] ~context:[] ~env ~uri:None ~is_path:false ty
429 let height = (* XXX calculate *) 0 in
431 (match bo,flavour with
433 NCic.Constant ([],name,None,ty',attrs)
434 | Some _,`Axiom -> assert false
436 NCic.Constant ([],name,Some (NCic.Implicit `Term),ty',attrs)
439 | NotationPt.LetRec (kind, defs, _) ->
440 let inductive = kind = `Inductive in
443 (fun (i,acc) (_,(name,_),_,k) ->
445 (ncic_name_of_ident name, NReference.reference_of_spec uri
446 (if inductive then NReference.Fix (i,k,0)
447 else NReference.CoFix i)) :: acc))
452 (fun (params, (name, typ), body, decr_idx) ->
453 let add_binders kind t =
456 NotationPt.Binder (kind, var, t)) params t
459 interpretate_term status
460 ~obj_context ~context ~env ~uri:None ~is_path:false
461 (add_binders `Lambda body)
464 interpretate_term_option status
466 ~context ~env ~uri:None ~is_path:false `Type
467 (HExtlib.map_option (add_binders `Pi) typ)
469 ([],ncic_name_of_ident name, decr_idx, cic_type, cic_body))
472 NCic.Fixpoint (inductive,inductiveFuns,attrs)
475 interpretate_term status
476 ~obj_context:[] ~context:[] ~env ~uri:None ~is_path:false bo
478 NCic.Constant ([],name,Some bo,ty',attrs)))
479 | NotationPt.Inductive (params,tyl) ->
483 (fun (context,res) (name,t) ->
486 None -> NotationPt.Implicit `JustOne
488 let name = cic_name_of_name name in
490 interpretate_term status ~obj_context:[] ~context ~env ~uri:None
493 (name,NCic.Decl t)::context,(name,t)::res
496 context,List.rev res in
498 List.fold_right (fun (name,ty) t -> NCic.Prod (name,ty,t)) params in
499 let leftno = List.length params in
500 let _,inductive,_,_ = try List.hd tyl with Failure _ -> assert false in
504 (fun (i,res) (name,_,_,_) ->
506 NReference.reference_of_spec uri (NReference.Ind (inductive,i,leftno))
508 i+1,(name,nref)::res)
512 (fun (name,_,ty,cl) ->
515 (interpretate_term status ~obj_context:[] ~context ~env ~uri:None
516 ~is_path:false ty) in
522 (interpretate_term status ~obj_context ~context ~env ~uri:None
523 ~is_path:false ty) in
524 let relevance = [] in
527 let relevance = [] in
528 relevance,name,ty',cl'
531 let height = (* XXX calculate *) 0 in
532 let attrs = `Provided, `Regular in
534 NCic.Inductive (inductive,leftno,tyl,attrs)
535 | NotationPt.Record (params,name,ty,fields) ->
539 (fun (context,res) (name,t) ->
542 None -> NotationPt.Implicit `JustOne
544 let name = cic_name_of_name name in
546 interpretate_term status ~obj_context:[] ~context ~env ~uri:None
549 (name,NCic.Decl t)::context,(name,t)::res
552 context,List.rev res in
554 List.fold_right (fun (name,ty) t -> NCic.Prod (name,ty,t)) params in
555 let leftno = List.length params in
558 (interpretate_term status ~obj_context:[] ~context ~env ~uri:None
559 ~is_path:false ty) in
561 NReference.reference_of_spec uri (NReference.Ind (true,0,leftno)) in
562 let obj_context = [name,nref] in
566 (fun (context,res) (name,ty,_coercion,_arity) ->
568 interpretate_term status ~obj_context ~context ~env ~uri:None
570 let context' = (name,NCic.Decl ty)::context in
571 context',(name,ty)::res
572 ) (context,[]) fields) in
574 let mutind = NCic.Const nref in
575 if params = [] then mutind
578 (mutind::mk_rels (List.length params) (List.length fields)) in
580 List.fold_left (fun t (name,ty) -> NCic.Prod (name,ty,t)) concl fields' in
581 let con' = add_params con in
582 let relevance = [] in
583 let tyl = [relevance,name,ty',[relevance,"mk_" ^ name,con']] in
584 let field_names = List.map (fun (x,_,y,z) -> x,y,z) fields in
585 let height = (* XXX calculate *) 0 in
586 let attrs = `Provided, `Record field_names in
588 NCic.Inductive (true,leftno,tyl,attrs)
591 let disambiguate_term (status: #NCicCoercion.status) ~context ~metasenv ~subst
592 ~expty ~mk_implicit ~description_of_alias ~fix_instance ~mk_choice
593 ~aliases ~universe ~lookup_in_library (text,prefix_len,term)
595 let mk_localization_tbl x = NCicUntrusted.NCicHash.create x in
597 MultiPassDisambiguator.disambiguate_thing
598 ~freshen_thing:NotationUtil.freshen_term
599 ~context ~metasenv ~initial_ugraph:() ~aliases
600 ~mk_implicit ~description_of_alias ~fix_instance
601 ~string_context_of_context:(List.map (fun (x,_) -> Some x))
602 ~universe ~uri:None ~pp_thing:(NotationPp.pp_term status)
603 ~passes:(MultiPassDisambiguator.passes ())
604 ~lookup_in_library ~domain_of_thing:Disambiguate.domain_of_term
605 ~interpretate_thing:(interpretate_term status ~obj_context:[] ~mk_choice (?create_dummy_ids:None))
606 ~refine_thing:(refine_term status) (text,prefix_len,term)
607 ~mk_localization_tbl ~expty ~subst
609 List.map (function (a,b,c,d,_) -> a,b,c,d) res, b
612 let disambiguate_obj (status: #NCicCoercion.status)
613 ~mk_implicit ~description_of_alias ~fix_instance ~mk_choice
614 ~aliases ~universe ~lookup_in_library ~uri (text,prefix_len,obj)
616 let mk_localization_tbl x = NCicUntrusted.NCicHash.create x in
618 MultiPassDisambiguator.disambiguate_thing
619 ~freshen_thing:NotationUtil.freshen_obj
620 ~context:[] ~metasenv:[] ~subst:[] ~initial_ugraph:() ~aliases
621 ~mk_implicit ~description_of_alias ~fix_instance
622 ~string_context_of_context:(List.map (fun (x,_) -> Some x))
625 ~pp_thing:(NotationPp.pp_obj (NotationPp.pp_term status))
626 ~passes:(MultiPassDisambiguator.passes ())
627 ~lookup_in_library ~domain_of_thing:Disambiguate.domain_of_obj
628 ~interpretate_thing:(interpretate_obj status ~mk_choice)
629 ~refine_thing:(refine_obj status)
630 (text,prefix_len,obj)
631 ~mk_localization_tbl ~expty:`XTNone
633 List.map (function (a,b,c,d,_) -> a,b,c,d) res, b
639 [false, NUri.uri_of_string ("cic:/matita/pts/Type.univ")]
641 [false, NUri.uri_of_string ("cic:/matita/pts/Type"^string_of_int n^".univ")]
645 [false, NUri.uri_of_string ("cic:/matita/pts/CProp.univ")]
647 [false, NUri.uri_of_string ("cic:/matita/pts/CProp"^string_of_int n^".univ")]
649 NCicEnvironment.add_constraint true (mk_type 0) (mk_type 1);
650 NCicEnvironment.add_constraint true (mk_cprop 0) (mk_cprop 1);
651 NCicEnvironment.add_constraint true (mk_cprop 0) (mk_type 1);
652 NCicEnvironment.add_constraint true (mk_type 0) (mk_cprop 1);
653 NCicEnvironment.add_constraint false (mk_cprop 0) (mk_type 0);
654 NCicEnvironment.add_constraint false (mk_type 0) (mk_cprop 0);
656 NCicEnvironment.add_constraint true (mk_type 1) (mk_type 2);
657 NCicEnvironment.add_constraint true (mk_cprop 1) (mk_cprop 2);
658 NCicEnvironment.add_constraint true (mk_cprop 1) (mk_type 2);
659 NCicEnvironment.add_constraint true (mk_type 1) (mk_cprop 2);
660 NCicEnvironment.add_constraint false (mk_cprop 1) (mk_type 1);
661 NCicEnvironment.add_constraint false (mk_type 1) (mk_cprop 1);
663 NCicEnvironment.add_constraint true (mk_type 2) (mk_type 3);
664 NCicEnvironment.add_constraint true (mk_cprop 2) (mk_cprop 3);
665 NCicEnvironment.add_constraint true (mk_cprop 2) (mk_type 3);
666 NCicEnvironment.add_constraint true (mk_type 2) (mk_cprop 3);
667 NCicEnvironment.add_constraint false (mk_cprop 2) (mk_type 2);
668 NCicEnvironment.add_constraint false (mk_type 2) (mk_cprop 2);
670 NCicEnvironment.add_constraint false (mk_cprop 3) (mk_type 3);
671 NCicEnvironment.add_constraint false (mk_type 3) (mk_cprop 3);