X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fgrafite_engine%2FgrafiteEngine.ml;h=59e3d5cf9e69ef8831014a186895b11411e31ea0;hb=aef659e5893b4bf8c8544d0c54714e10f5b5493a;hp=26fc540d89224d7567081341554f75f7685cb273;hpb=185bfc8f9c9ba49308477ee6769701f3e2977115;p=helm.git diff --git a/helm/software/components/grafite_engine/grafiteEngine.ml b/helm/software/components/grafite_engine/grafiteEngine.ml index 26fc540d8..59e3d5cf9 100644 --- a/helm/software/components/grafite_engine/grafiteEngine.ml +++ b/helm/software/components/grafite_engine/grafiteEngine.ml @@ -416,10 +416,8 @@ let refinement_toolkit = { } let eval_coercion status ~add_composites uri = - let basedir = Helm_registry.get "matita.basedir" in let status,compounds = - prerr_endline "evaluating a coercion command"; - GrafiteSync.add_coercion ~basedir ~add_composites refinement_toolkit status uri in + GrafiteSync.add_coercion ~add_composites refinement_toolkit status uri in let moo_content = coercion_moo_statement_of uri in let status = GrafiteTypes.add_moo_content [moo_content] status in {status with GrafiteTypes.proof_status = GrafiteTypes.No_proof}, @@ -555,22 +553,26 @@ let add_coercions_of_record_to_moo obj lemmas status = lemmas let add_obj uri obj status = - let basedir = Helm_registry.get "matita.basedir" in - let status,lemmas = GrafiteSync.add_obj ~basedir refinement_toolkit uri obj status in + let status,lemmas = GrafiteSync.add_obj refinement_toolkit uri obj status in status, lemmas let rec eval_command = {ec_go = fun ~disambiguate_command opts status cmd -> let status,cmd = disambiguate_command status cmd in - let basedir = Helm_registry.get "matita.basedir" in let status,uris = match cmd with | GrafiteAst.Default (loc, what, uris) as cmd -> LibraryObjects.set_default what uris; GrafiteTypes.add_moo_content [cmd] status,[] | GrafiteAst.Include (loc, baseuri) -> - let moopath = LibraryMisc.obj_file_of_baseuri ~basedir ~baseuri in - if not (Sys.file_exists moopath) then - raise (IncludedFileNotCompiled moopath); + let moopath_rw, moopath_r = + LibraryMisc.obj_file_of_baseuri ~baseuri ~writable:true, + LibraryMisc.obj_file_of_baseuri ~baseuri ~writable:false + in + let moopath = + if Sys.file_exists moopath_r then moopath_r else + if Sys.file_exists moopath_rw then moopath_rw else + raise (IncludedFileNotCompiled moopath_rw) + in let status = eval_from_moo.efm_go status moopath in status,[] | GrafiteAst.Set (loc, name, value) -> @@ -586,10 +588,13 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status cmd -> HLog.error (sprintf "uri %s belongs to a read-only repository" value); raise (ReadOnlyUri value) end; - if not (GrafiteMisc.is_empty value) && opts.clean_baseuri then begin + if not (Http_getter_storage.is_empty value) && + opts.clean_baseuri + then begin HLog.message ("baseuri " ^ value ^ " is not empty"); HLog.message ("cleaning baseuri " ^ value); - LibraryClean.clean_baseuris ~basedir [value]; + LibraryClean.clean_baseuris [value]; + assert (Http_getter_storage.is_empty value); end; end; GrafiteTypes.set_option status name value,[] @@ -628,8 +633,8 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status cmd -> (match types with (name,_,_,_)::_ -> name | _ -> assert false) | _ -> assert false in let uri = - UriManager.uri_of_string (GrafiteTypes.qualify status name ^ ext) - in + UriManager.uri_of_string (GrafiteTypes.qualify status name ^ ext) in + let obj = CicRefine.pack_coercion_obj obj in let metasenv = GrafiteTypes.get_proof_metasenv status in match obj with | Cic.CurrentProof (_,metasenv',bo,ty,_,_) -> @@ -664,9 +669,8 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status cmd -> ("Theorem already proved: " ^ UriManager.string_of_uri x ^ "\nPlease use a variant.")); end; - assert (metasenv = metasenv'); - let initial_proof = (Some uri, metasenv, bo, ty) in - let initial_stack = Continuationals.Stack.of_metasenv metasenv in + let initial_proof = (Some uri, metasenv', bo, ty) in + let initial_stack = Continuationals.Stack.of_metasenv metasenv' in { status with GrafiteTypes.proof_status = GrafiteTypes.Incomplete_proof { GrafiteTypes.proof = initial_proof; stack = initial_stack } },