]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql_interpreter/mQILib.mli
standard library and while construction inserted
[helm.git] / helm / ocaml / mathql_interpreter / mQILib.mli
index f5e1874577c0231d8ab6c3f2c30102fbeae7b9ca..bfac2b4ff13cc4d6c883a92761890999660c5214 100644 (file)
@@ -60,4 +60,45 @@ exception ArityError of MathQL.path * arity_t * int
 
 exception NameError of MathQL.path
 
-exception NumberError of MathQL.result
+type std_text_out_spec = {s_out    : string -> unit;
+                          s_path   : MathQL.path -> unit;
+                         s_query  : MathQL.query -> unit;
+                         s_result : MathQL.result -> unit
+}
+
+val std : text_out_spec -> std_text_out_spec
+
+(* function registration ****************************************************)
+
+type fun_spec = {arity_p : arity_t;
+                 arity_s : arity_t;
+                 body    : eval_spec -> text_out_spec -> text_in_spec ->
+                          MathQL.path list -> MathQL.query list -> MathQL.result;
+                txt_out : text_out_spec ->  
+                          MathQL.path list -> MathQL.query list -> unit
+               }
+
+val fun_register : MathQL.path -> fun_spec -> unit
+
+val fun_arity0   : MathQL.path -> string -> MathQL.result -> fun_spec
+
+val fun_arity1   : MathQL.path -> string -> (MathQL.result -> MathQL.result) -> fun_spec
+
+val fun_arity2   : MathQL.path -> string -> (MathQL.result ->  MathQL.result -> MathQL.result) -> fun_spec
+
+val out_txt2     : std_text_out_spec -> 
+                   string -> MathQL.query -> MathQL.query -> unit 
+
+val out_txt_     : std_text_out_spec -> 
+                   MathQL.path -> MathQL.query list -> unit 
+
+val out_txt_full : std_text_out_spec -> 
+                   MathQL.path -> MathQL.path list -> MathQL.query list -> unit 
+
+(* generator registration ***************************************************)
+
+type gen_spec = {arity : arity_t;
+                 code  : eval_spec ->  MathQL.query list ->  MathQL.query
+                }
+
+val gen_register : MathQL.path -> gen_spec -> unit