X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matitaB%2Fcomponents%2Fgrafite_engine%2FgrafiteEngine.ml;h=cbaa4d93a8f38f8b845476910d89ca51cb8422d9;hb=ef23dc44fb01f7cb94df065c1288398e8f08d3ed;hp=d2f12dc9dde5640dde9b910928c203140314718e;hpb=6d4277977478ef9bcadaffbef3d4bb04ac0250a5;p=helm.git diff --git a/matitaB/components/grafite_engine/grafiteEngine.ml b/matitaB/components/grafite_engine/grafiteEngine.ml index d2f12dc9d..cbaa4d93a 100644 --- a/matitaB/components/grafite_engine/grafiteEngine.ml +++ b/matitaB/components/grafite_engine/grafiteEngine.ml @@ -44,7 +44,7 @@ let inject_unification_hint = ~alias_only status = if not alias_only then - let t = refresh_uri_in_term (status :> NCic.status) t in + let t = refresh_uri_in_term (status :> NCicEnvironment.status) t in basic_eval_unification_hint (t,n) status else status @@ -134,13 +134,12 @@ let eval_alias status data= let basic_eval_input_notation (l1,l2) status = GrafiteParser.extend status l1 (fun env loc -> - let rec inner_loc default = function - | [] -> default - | (_,(NotationEnv.NoType,NotationEnv.LocValue l))::_ -> l - | _::tl -> inner_loc default tl + let rec get_disamb = function + | [] -> Stdpp.dummy_loc,None,None + | (_,(NotationEnv.NoType,NotationEnv.DisambiguationValue dv))::_ -> dv + | _::tl -> get_disamb tl in - let inner_loc = inner_loc loc env in - let l2' = TermContentPres.instantiate_level2 status env inner_loc l2 in + let l2' = TermContentPres.instantiate_level2 status env (get_disamb env) l2 in prerr_endline ("new l2 ast : " ^ (NotationPp.pp_term status l2')); NotationPt.AttributedTerm (`Loc loc,l2')) ;; @@ -153,10 +152,10 @@ let inject_input_notation = if not alias_only then let l1 = CicNotationParser.refresh_uri_in_checked_l1_pattern - ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCic.status)) + ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCicEnvironment.status)) ~refresh_uri_in_reference l1 in let l2 = NotationUtil.refresh_uri_in_term - ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCic.status)) + ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCicEnvironment.status)) ~refresh_uri_in_reference l2 in basic_eval_input_notation (l1,l2) status @@ -184,10 +183,10 @@ let inject_output_notation = if not alias_only then let l1 = CicNotationParser.refresh_uri_in_checked_l1_pattern - ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCic.status)) + ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCicEnvironment.status)) ~refresh_uri_in_reference l1 in let l2 = NotationUtil.refresh_uri_in_term - ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCic.status)) + ~refresh_uri_in_term:(refresh_uri_in_term (status:>NCicEnvironment.status)) ~refresh_uri_in_reference l2 in basic_eval_output_notation (l1,l2) status @@ -207,7 +206,7 @@ let record_index_obj = let aux l ~refresh_uri_in_universe ~refresh_uri_in_term ~refresh_uri_in_reference ~alias_only status = - let refresh_uri_in_term = refresh_uri_in_term (status:>NCic.status) in + let refresh_uri_in_term = refresh_uri_in_term (status:>NCicEnvironment.status) in if not alias_only then basic_index_obj (List.map @@ -323,7 +322,7 @@ let inject_constraint = (* NCicLibrary.add_constraint adds the constraint to the NCicEnvironment * and also to the storage (for undo/redo). During inclusion of compiled * files the storage must not be touched. *) - NCicEnvironment.add_lt_constraint u1 u2; + NCicEnvironment.add_lt_constraint status u1 u2; status else status @@ -608,7 +607,8 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = let status = status#set_ng_mode `CommandMode in status) status (NCic.Prop:: - List.map (fun s -> NCic.Type s) (NCicEnvironment.get_universes ())) + List.map (fun s -> NCic.Type s) + (NCicEnvironment.get_universes status)) | _ -> status in let coercions = @@ -772,8 +772,11 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) = if dir <> Some `RightToLeft then eval_input_notation status (l1,l2) else status in + let status = if dir <> Some `LeftToRight then eval_output_notation status (l1,l2) else status + in prerr_endline ("new grammar:\n" ^ (Print_grammar.ebnf_of_term status)); + status | GrafiteAst.Alias (loc, spec) -> let diff = (*CSC: Warning: this code should be factorized with the corresponding