in
HLog.debug "Procedural: grafite rendering";
List.rev (T.render_steps [] steps)
+
+let rec is_debug n = function
+ | [] -> false
+ | G.IPDebug debug :: _ -> debug <= n
+ | _ :: tl -> is_debug n tl
GrafiteAst.statement list
val tex_formatter: Format.formatter option ref
+
+val is_debug: int -> GrafiteAst.inline_param list -> bool
module HG = Http_getter
module GA = GrafiteAst
-module T = Types
-module G = Grafite
+module T = Types
+module G = Grafite
module O = Options
type script = {
let default_scripts = 2
+let suffix = ".conf.xml"
+
let load_registry registry =
- let suffix = ".conf.xml" in
let registry =
if Filename.check_suffix registry suffix then registry
else registry ^ suffix
| None -> List.rev files
| Some l ->
let l = trim l in
- if List.mem l st.excludes then aux files else aux (l :: files)
- in
+ if List.mem l st.excludes then aux files else
+ if !O.sources = [] || List.mem l !O.sources then aux (l :: files) else
+ aux files
+ in
let files = aux [] in
let _ = Unix.close_process_in ich in
{st with files = files}
Filename.concat st.output_path (name ^ ext)
let get_iparams st name =
+ let debug debug = GA.IPDebug debug in
let map = function
| "nodefaults" -> GA.IPNoDefaults
| "coercions" -> GA.IPCoercions
| "comments" -> GA.IPComments
- | s -> failwith ("unknown inline parameter: " ^ s)
+ | s ->
+ try Scanf.sscanf s "debug-%u" debug with
+ | Scanf.Scan_failure _
+ | Failure _
+ | End_of_file ->
+ failwith ("unknown inline parameter: " ^ s)
in
List.map map (X.list_assoc_all name st.iparams)
type status
+val suffix: string
+
val init: unit -> unit
val make: string -> status
let comments = ref true
let getter = ref false
+
+let sources = ref ([]: string list)
let help_p = " verbose parsing" in
let help_x = " verbose character escaping" in
let set_cwd dir = Options.cwd := dir; Engine.init () in
- let process_package package = Engine.produce (Engine.make package) in
+ let process_file file =
+ if Sys.file_exists file || Sys.file_exists (file ^ Engine.suffix) then
+ begin Engine.produce (Engine.make file); Options.sources := [] end
+ else
+ Options.sources := file :: !Options.sources
+ in
Arg.parse [
("-C", Arg.String set_cwd, help_C);
("-g", Arg.Set Options.getter, help_g);
("-m", Arg.Clear Options.comments, help_m);
("-p", Arg.Set Options.verbose_parser, help_p);
("-x", Arg.Set Options.verbose_escape, help_x);
- ] process_package help
+ ] process_file help
(fun (params, name, ty, body, rec_param) ->
[ break;
hvbox false true ([
- keyword "and";
+ keyword "and"; space;
name] @
params @
[space; keyword "on" ; space; rec_param ;space ] @
-utf8Macro.cmi:
-utf8MacroTable.cmo:
-utf8MacroTable.cmx:
utf8Macro.cmo: utf8MacroTable.cmo utf8Macro.cmi
utf8Macro.cmx: utf8MacroTable.cmx utf8Macro.cmi
module Ds = CicDischarge
module PO = ProceduralOptimizer
module N = CicNotationPt
+module A2P = Acic2Procedural
let mpres_document pres_box =
Xml.add_xml_declaration (CicNotationPres.print_box pres_box)
failwith msg
in
if List.mem G.IPProcedural params then begin
-(*
- PO.debug := true;
+
+ Procedural2.debug := A2P.is_debug 1 params;
+ PO.debug := A2P.is_debug 2 params;
+(*
PO.critical := false;
- Acic2Procedural.tex_formatter := Some Format.std_formatter;
+ A2P.tex_formatter := Some Format.std_formatter;
let _ = ProceduralTeX.tex_of_obj Format.std_formatter obj in
*)
let obj, info = PO.optimize_obj obj in
str
in
let script =
- Acic2Procedural.procedural_of_acic_object
+ A2P.procedural_of_acic_object
~ids_to_inner_sorts ~ids_to_inner_types ~info params aobj
in
String.concat "" (List.map aux script) ^ "\n\n"
let aux = GrafiteAstPp.pp_statement
~map_unicode_to_tex ~term_pp ~lazy_term_pp ~obj_pp in
let script =
- Acic2Procedural.procedural_of_acic_term
+ A2P.procedural_of_acic_term
~ids_to_inner_sorts ~ids_to_inner_types params context annterm
in
String.concat "" (List.map aux script)
mma: $(DEVEL).conf.xml clean.ma
$(H)$(TRANSCRIPT) $(TRANSCRIPTOPTIONS) -C $(BIN) $(DEVEL)
+
+%.ts: $(DEVEL).conf.xml
+ $(H)$(BIN)matitaclean.opt $(MATITAOPTIONS) $*.ma
+ $(H)$(RM) $*.ma
+ $(H)$(TRANSCRIPT) $(TRANSCRIPTOPTIONS) -C $(BIN) $* $(DEVEL)
+
<key name="output_type">procedural</key>
<key name="heading_lines">14</key>
<key name="theory_file"></key>
+ <key name="inline">* debug-2</key>
<key name="inline">logic/equality/symmetric_eq nodefaults</key>
<key name="inline">logic/equality/transitive_eq nodefaults</key>
<key name="inline">logic/equality/eq_elim_r nodefaults</key>