X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_disambiguation%2FnCicDisambiguate.ml;h=bfe12cee70bf5174000fd9cd44ed6a539a43d1bc;hb=164332b640d2c2e601350065b0074ba80426ea5c;hp=4092e7ae035250f11a43f1151d0ea8263a057da5;hpb=62f476a05884d451bfb90d845ea2b1c0a1c77f96;p=helm.git diff --git a/helm/software/components/ng_disambiguation/nCicDisambiguate.ml b/helm/software/components/ng_disambiguation/nCicDisambiguate.ml index 4092e7ae0..bfe12cee7 100644 --- a/helm/software/components/ng_disambiguation/nCicDisambiguate.ml +++ b/helm/software/components/ng_disambiguation/nCicDisambiguate.ml @@ -40,7 +40,8 @@ let refine_term assert false in let metasenv, subst, term, _ = - NCicRefiner.typeof + NCicRefiner.typeof + (NCicUnifHint.db ()) ~look_for_coercion:( if use_coercions then NCicCoercion.look_for_coercion coercion_db @@ -76,9 +77,6 @@ let interpretate_term assert (uri = None); let rec aux ~localize loc context = function - t -> - let res = - match t with | CicNotationPt.AttributedTerm (`Loc loc, term) -> let res = aux ~localize loc context term in if localize then @@ -187,7 +185,7 @@ let interpretate_term List.nth itl indtyp_no with _ -> assert false in let rec count_prod t = - match NCicReduction.whd [] t with + match NCicReduction.whd ~subst:[] [] t with NCic.Prod (_, _, t) -> 1 + (count_prod t) | _ -> 0 in @@ -399,16 +397,17 @@ patterns not implemented *) [false,NUri.uri_of_string "cic:/matita/pts/Type.univ"]) | CicNotationPt.Sort (`Type _u) -> NCic.Sort (NCic.Type [false,NUri.uri_of_string "cic:/matita/pts/Type.univ"]) + | CicNotationPt.Sort (`NType s) -> NCic.Sort (NCic.Type + [false,NUri.uri_of_string ("cic:/matita/pts/Type" ^ s ^ ".univ")]) | CicNotationPt.Sort (`CProp _u) -> NCic.Sort (NCic.Type [false,NUri.uri_of_string "cic:/matita/pts/CProp.univ"]) | CicNotationPt.Symbol (symbol, instance) -> Disambiguate.resolve ~env ~mk_choice (Symbol (symbol, instance)) (`Args []) - | _ -> assert false (* god bless Bologna *) - - in -(* prerr_endline (NCicPp.ppterm ~metasenv:[] ~context:[] ~subst:[] res); *) - res + | CicNotationPt.Variable _ + | CicNotationPt.Magic _ + | CicNotationPt.Layout _ + | CicNotationPt.Literal _ -> assert false (* god bless Bologna *) and aux_option ~localize loc context annotation = function | None -> NCic.Implicit annotation | Some (CicNotationPt.AttributedTerm (`Loc loc, term)) -> @@ -431,10 +430,6 @@ let interpretate_term ?(create_dummy_ids=false) ~context ~env ~uri ~is_path ast ~localization_tbl ;; -let domain_of_term ~context = - Disambiguate.domain_of_ast_term ~context -;; - let disambiguate_term ~context ~metasenv ~subst ?goal ~mk_implicit ~description_of_alias ~mk_choice ~aliases ~universe ~coercion_db ~lookup_in_library @@ -463,7 +458,7 @@ let disambiguate_term ~context ~metasenv ~subst ?goal ~string_context_of_context:(List.map (fun (x,_) -> Some x)) ~universe ~uri:None ~pp_thing:CicNotationPp.pp_term ~passes:(MultiPassDisambiguator.passes ()) - ~lookup_in_library ~domain_of_thing:domain_of_term + ~lookup_in_library ~domain_of_thing:Disambiguate.domain_of_term ~interpretate_thing:(interpretate_term ~mk_choice (?create_dummy_ids:None)) ~refine_thing:(refine_term ~coercion_db) (text,prefix_len,term) ~mk_localization_tbl ~hint ~subst @@ -490,5 +485,23 @@ in NCicEnvironment.add_constraint true (mk_type 0) (mk_cprop 1); NCicEnvironment.add_constraint false (mk_cprop 0) (mk_type 0); NCicEnvironment.add_constraint false (mk_type 0) (mk_cprop 0); + + NCicEnvironment.add_constraint true (mk_type 1) (mk_type 2); + NCicEnvironment.add_constraint true (mk_cprop 1) (mk_cprop 2); + NCicEnvironment.add_constraint true (mk_cprop 1) (mk_type 2); + NCicEnvironment.add_constraint true (mk_type 1) (mk_cprop 2); + NCicEnvironment.add_constraint false (mk_cprop 1) (mk_type 1); + NCicEnvironment.add_constraint false (mk_type 1) (mk_cprop 1); + + NCicEnvironment.add_constraint true (mk_type 2) (mk_type 3); + NCicEnvironment.add_constraint true (mk_cprop 2) (mk_cprop 3); + NCicEnvironment.add_constraint true (mk_cprop 2) (mk_type 3); + NCicEnvironment.add_constraint true (mk_type 2) (mk_cprop 3); + NCicEnvironment.add_constraint false (mk_cprop 2) (mk_type 2); + NCicEnvironment.add_constraint false (mk_type 2) (mk_cprop 2); + + NCicEnvironment.add_constraint false (mk_cprop 3) (mk_type 3); + NCicEnvironment.add_constraint false (mk_type 3) (mk_cprop 3); + ;;