-module MQX = MQueryMisc
-module MQI = MQueryInterpreter
-module MQIC = MQIConn
-module MQG = MQueryGenerator
+module U = MQueryUtil
+module I = MQueryInterpreter
+module C = MQIConn
+module G = MQueryGenerator
+module L = MQGTopLexer
+module P = MQGTopParser
+module TL = CicTextualLexer
+module TP = CicTextualParser
+module C2 = MQueryLevels2
+module C1 = MQueryLevels
- | T.ID s -> P.ID s
- | T.CONURI u -> P.CONURI u
- | T.VARURI u -> P.VARURI u
- | T.INDTYURI (u, p) -> P.INDTYURI (u, p)
- | T.INDCONURI (u, p, s) -> P.INDCONURI (u, p, s)
- | T.LETIN -> P.ALIAS
- | T.EOF -> P.EOF
+ | TP.ID s -> P.ID s
+ | TP.CONURI u -> P.CONURI u
+ | TP.VARURI u -> P.VARURI u
+ | TP.INDTYURI (u, p) -> P.INDTYURI (u, p)
+ | TP.INDCONURI (u, p, s) -> P.INDCONURI (u, p, s)
+ | TP.LETIN -> P.ALIAS
+ | TP.EOF -> P.EOF
let handle = get_handle () in
let rec pattern level = function
| [] -> ()
| term :: tail ->
pattern level tail;
print_string ("? " ^ CicPp.ppterm term ^ nl);
let handle = get_handle () in
let rec pattern level = function
| [] -> ()
| term :: tail ->
pattern level tail;
print_string ("? " ^ CicPp.ppterm term ^ nl);
- let t = MQX.start_time () in
- let om,rm,sm = C.get_constraints term in
+ let t = U.start_time () in
+ let om,rm,sm = C2.get_constraints term in
let oml,rml,sml = List.length om, List.length rm, List.length sm in
let oo, ool = if level land 1 = 0 then None, 0 else Some om, oml in
let ro, rol = if level land 2 = 0 then None, 0 else Some rm, rml in
let so, sol = if level land 4 = 0 then None, 0 else Some sm, sml in
let oml,rml,sml = List.length om, List.length rm, List.length sm in
let oo, ool = if level land 1 = 0 then None, 0 else Some om, oml in
let ro, rol = if level land 2 = 0 then None, 0 else Some rm, rml in
let so, sol = if level land 4 = 0 then None, 0 else Some sm, sml in
- let q = MQG.query_of_constraints None (om,rm,sm) (oo,ro,so) in
+ let q = G.query_of_constraints univ (om,rm,sm) (oo,ro,so) in
if not (List.mem q ! queries) then
begin
issue handle q;
Printf.eprintf "[%i] " (pred ! query_num); flush stderr;
Printf.printf "%i GEN = %i: %s"
(pred ! query_num) (oml + rml + sml + ool + rol + sol)
if not (List.mem q ! queries) then
begin
issue handle q;
Printf.eprintf "[%i] " (pred ! query_num); flush stderr;
Printf.printf "%i GEN = %i: %s"
(pred ! query_num) (oml + rml + sml + ool + rol + sol)
- let t0 = Sys.time () in
- let list_of_must, only = C.out_restr [] [] term in
+ let t = U.start_time () in
+ let list_of_must, only = C1.out_restr [] [] term in
let max_level = pred (List.length list_of_must) in
let must = List.nth list_of_must (min level max_level) in
let rigth_must = List.map torigth_restriction must in
let rigth_only = Some (List.map torigth_restriction only) in
let max_level = pred (List.length list_of_must) in
let must = List.nth list_of_must (min level max_level) in
let rigth_must = List.map torigth_restriction must in
let rigth_only = Some (List.map torigth_restriction only) in
- let q = G.searchPattern (rigth_must, [], []) (rigth_only , None, None) in
+ let q = G.query_of_constraints univ (rigth_must, [], []) (rigth_only , None, None) in
let check () =
let handle = get_handle () in
Printf.eprintf
"mqgtop: current options: %s, connection: %s\n"
let check () =
let handle = get_handle () in
Printf.eprintf
"mqgtop: current options: %s, connection: %s\n"
prerr_endline "-i -interp FILE sets the CIC short names interpretation file";
prerr_endline "-d -disply outputs the CIC terms given in the input file";
prerr_endline "-L -locate ALIAS issues the \"Locate\" query for the given alias";
prerr_endline "-i -interp FILE sets the CIC short names interpretation file";
prerr_endline "-d -disply outputs the CIC terms given in the input file";
prerr_endline "-L -locate ALIAS issues the \"Locate\" query for the given alias";
prerr_endline " from the input file";
prerr_endline "-B -backward LEVEL issues the \"Backward\" query for the given level on all";
prerr_endline " CIC terms in the input file";
prerr_endline "-MB -multi-backward MAX issues the \"Backward\" query for each level from max to 0";
prerr_endline " on all CIC terms in the input file";
prerr_endline " from the input file";
prerr_endline "-B -backward LEVEL issues the \"Backward\" query for the given level on all";
prerr_endline " CIC terms in the input file";
prerr_endline "-MB -multi-backward MAX issues the \"Backward\" query for each level from max to 0";
prerr_endline " on all CIC terms in the input file";
prerr_endline " CIC terms in the input file";
prerr_endline "-MP -multi-pattern issues the \"Pattern\" query for each level from 7 to 0";
prerr_endline " on all CIC terms in the input file\n";
prerr_endline " CIC terms in the input file";
prerr_endline "-MP -multi-pattern issues the \"Pattern\" query for each level from 7 to 0";
prerr_endline " on all CIC terms in the input file\n";
| ("-c"|"-check") :: rem -> check (); parse rem
| ("-l"|"-log-file") :: arg :: rem -> log_file := arg; parse rem
| ("-L"|"-Locate") :: arg :: rem -> locate arg; parse rem
| ("-c"|"-check") :: rem -> check (); parse rem
| ("-l"|"-log-file") :: arg :: rem -> log_file := arg; parse rem
| ("-L"|"-Locate") :: arg :: rem -> locate arg; parse rem
| ("-M"|"-backward") :: arg :: rem ->
let m = (int_of_string arg) in mbackward m m (get_terms ()); parse rem
| ("-MB"|"-multi-backward") :: arg :: rem ->
let m = (int_of_string arg) in mbackward m 0 (get_terms ()); parse rem
| ("-M"|"-backward") :: arg :: rem ->
let m = (int_of_string arg) in mbackward m m (get_terms ()); parse rem
| ("-MB"|"-multi-backward") :: arg :: rem ->
let m = (int_of_string arg) in mbackward m 0 (get_terms ()); parse rem
let m = (int_of_string arg) in mpattern m m (get_terms ()); parse rem
| ("-MP"|"-multi-pattern") :: rem -> mpattern 7 0 (get_terms ()); parse rem
| _ :: rem -> parse rem
let _ =
let m = (int_of_string arg) in mpattern m m (get_terms ()); parse rem
| ("-MP"|"-multi-pattern") :: rem -> mpattern 7 0 (get_terms ()); parse rem
| _ :: rem -> parse rem
let _ =
Logger.log_callback :=
(Logger.log_to_html
~print_and_flush:(fun s -> print_string s; flush stdout)) ;
parse (List.tl (Array.to_list Sys.argv));
Logger.log_callback :=
(Logger.log_to_html
~print_and_flush:(fun s -> print_string s; flush stdout)) ;
parse (List.tl (Array.to_list Sys.argv));