From: Claudio Sacerdoti Coen Date: Wed, 31 Aug 2005 10:53:16 +0000 (+0000) Subject: Since several weeks whelp did not compile any longer. Fixed: X-Git-Tag: working_equations_only~6 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=a9a13cf94e09df54438393ab65a33102abbc1b30;p=helm.git Since several weeks whelp did not compile any longer. Fixed: 1. the new getter implementation by Zack does not implement yet remote calls. I have changed the (sample) configuration file to use an internal getter (maybe also speeding up the tool?) 2. the new parser implementation does not have hard-coded notation. The notation is now loaded from two files on disk (core_notation.moo and coq.moo). I have added to entries in the configuration file to hold the path to the two moo files. 3. Whelp needs to parse and pretty-print the alias definitions. The old parser and pretty-printer was removed from CVS. I have re-used the new pretty-printer, but no parser was available. I have reimplemented it (in DisambiguatePp :-). The file should probably be renamed. Moreover, the code implemented is very redundant with the corresponding one in MatitaEngine --- diff --git a/helm/searchEngine/searchEngine.conf.xml.sample b/helm/searchEngine/searchEngine.conf.xml.sample index 86cc53cb5..6d646020f 100644 --- a/helm/searchEngine/searchEngine.conf.xml.sample +++ b/helm/searchEngine/searchEngine.conf.xml.sample @@ -6,8 +6,49 @@ mowgli
+ + /tmp/helm/cache + /projects/helm/xml/dtd + 58081 + 180 + /projects/helm/daemons/log/http_getter.log + + theory:/ file:///projects/helm/library/theories/ + + + xslt:/ file:///projects/helm/xml/stylesheets_ccorn/ + + + xslt:/ file:///projects/helm/xml/stylesheets_hanane/ + + + xslt:/ file:///projects/helm/xml/on-line/xslt/ + + + xslt:/ file:///projects/helm/nuprl/NuPRL/nuprl_stylesheets/ + + + nuprl:/ http://www.cs.uwyo.edu/~nuprl/helm-library/ + + + cic:/ file:///projects/helm/library/coq_contribs/ + + + xslt:/ file:///projects/helm/xml/stylesheets/ + + + xslt:/ file:///projects/helm/xml/stylesheets/generated/ + + + theory:/residual_theory_in_lambda_calculus/ + http://helm.cs.unibo.it/~sacerdot/huet_lambda_calculus_mowgli/residual_theory_in_lambda_calculus/ + + + theory:/IDA/ + http://mowgli.cs.unibo.it/~sacerdot/ida/IDA/ +
html @@ -15,5 +56,7 @@ 10 foo.env + /projects/helm/daemons/matita/core_notation.moo + /projects/helm/daemons/matita/coq.moo
diff --git a/helm/searchEngine/searchEngine.ml b/helm/searchEngine/searchEngine.ml index b7783acfb..c42c01043 100644 --- a/helm/searchEngine/searchEngine.ml +++ b/helm/searchEngine/searchEngine.ml @@ -155,7 +155,7 @@ let fold_n_to_m f n m acc = aux acc n let send_results results - ?(id_to_uris = CicTextualParser2.EnvironmentP3.of_string "") + ?(id_to_uris = DisambiguateTypes.empty_environment) (req: Http_types.request) outchan = let query_kind = query_kind_of_req req in @@ -248,9 +248,7 @@ let send_results results in iter_file (fun line -> - let new_aliases = - CicTextualParser2.EnvironmentP3.to_string id_to_uris - in + let new_aliases = DisambiguatePp.pp_environment id_to_uris in let processed_line = apply_substs (* CSC: Bug here: this is a string, not an array! *) @@ -294,7 +292,7 @@ let exec_action dbd (req: Http_types.request) outchan = (fun _ -> None) choices in - let id_to_uris = CicTextualParser2.EnvironmentP3.of_string id_to_uris_raw in + let id_to_uris = DisambiguatePp.parse_environment id_to_uris_raw in let id_to_choices = try parse_choices (req#param "choices") @@ -357,7 +355,7 @@ let exec_action dbd (req: Http_types.request) outchan = end in let module Disambiguate' = Disambiguate.Make(Chat) in - let ast = CicTextualParser2.parse_term (Stream.of_string term_str) in + let ast = Grammar.Entry.parse CicNotationParser.term (Stream.of_string term_str) in let (id_to_uris, metasenv, term) = match Disambiguate'.disambiguate_term ~dbd ~context ~metasenv @@ -383,8 +381,7 @@ let exec_action dbd (req: Http_types.request) outchan = let uri = match term with | Cic.MutInd (uri, typeno, _) -> - UriManager.uri_of_string - (UriManager.string_of_uriref (uri, [typeno])) + UriManager.uri_of_uriref uri typeno None | _ -> raise Not_a_MutInd in MetadataQuery.elim ~dbd uri @@ -461,7 +458,7 @@ let callback dbd (req: Http_types.request) outchan = | Chat_unfinished -> () | Http_types.Param_not_found attr_name -> bad_request (sprintf "Parameter '%s' is missing" attr_name) outchan - | CicTextualParser2.Parse_error (_, msg) -> + | CicNotationParser.Parse_error (_, msg) -> send_results (`Error (MooglePp.pp_error "Parse error" msg)) req outchan | Unbound_identifier id -> send_results (`Error (MooglePp.pp_error "Unbound identifier" id)) req @@ -484,6 +481,10 @@ let restore_environment () = close_in ic; printf "done!\n"; flush stdout +let read_notation () = + CicNotation.load_notation (Helm_registry.get "search_engine.notations"); + CicNotation.load_notation (Helm_registry.get "search_engine.interpretations") + let _ = printf "%s started and listening on port %d\n" daemon_name port; printf "Current directory is %s\n" (Sys.getcwd ()); @@ -498,6 +499,7 @@ let _ = () in restore_environment (); + read_notation (); Http_daemon.start' ~port (callback dbd); printf "%s is terminating, bye!\n" daemon_name