X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmathql_interpreter%2Fmqint.ml;h=a0c56e3848835e0cc8a65212d8227ae87e28008c;hb=fb4f3bb1bafb5d5541a777758b4074ee8e2de4ae;hp=053e20c74bb009fa5ecbef498a7a3f12cb4bfcfb;hpb=8207214be059c22b92976623035ee94e45e24486;p=helm.git diff --git a/helm/ocaml/mathql_interpreter/mqint.ml b/helm/ocaml/mathql_interpreter/mqint.ml index 053e20c74..a0c56e384 100644 --- a/helm/ocaml/mathql_interpreter/mqint.ml +++ b/helm/ocaml/mathql_interpreter/mqint.ml @@ -35,9 +35,9 @@ open Eval;; open Utility;; open Dbconn;; open Pattern;; -open Union;; +open Union;;*) open Intersect;; -open Diff;; +(*open Diff;; open Sortedby;; open Use;; open Select;; @@ -265,6 +265,8 @@ type rvar_context = (MathQL.rvar * MathQL.resource) list type group_context = (MathQL.rvar * MathQL.attribute_group) list +type vvar_context = (MathQL.vvar * MathQL.value) list + let svars = ref [] (* contesto delle svar *) @@ -272,13 +274,14 @@ let rvars = ref [] (* contesto delle rvar *) let groups = ref [] (* contesto dei gruppi *) +let vvars = ref [] (* contesto delle vvar introdotte con let-in *) -(* valuta una MathQL.set_exp e ritorna un MathQL.resource_set *) let rec exec_set_exp = function - | MathQL.Ref x -> [] - - + | MathQL.Ref vexp -> List.map (fun s -> (s,[])) (exec_val_exp vexp) + | MathQL.Intersect sexp1 sexp2 -> intersect_ex (exec_set_exp sexp1) (exec_set_exp sexp2) + | _ -> assert false + (* valuta una MathQL.boole_exp e ritorna un boole *) and exec_boole_exp = function @@ -286,17 +289,19 @@ and exec_boole_exp = function | MathQL.True -> true | MathQL.Not x -> not (exec_boole_exp x) | MathQL.And (x, y) -> (exec_boole_exp x) && (exec_boole_exp y) - | MathQL.Or (x, y) -> (exec_boole_exp x) || (exec_boole_exp y) - + | MathQL.Or (x, y) -> (exec_boole_exp x) || (exec_boole_exp y) + | _ -> assert false (* valuta una MathQL.val_exp e ritorna un MathQL.value *) and exec_val_exp = function - | MathQL.Const l -> [] - + | MathQL.Const x -> x + | _ -> assert false (* valuta una MathQL.set_exp nel contesto vuoto e ritorna un MathQL.resource_set *) +(* valuta una MathQL.set_exp e ritorna un MathQL.resource_set *) let execute x = - svars := []; rvars := []; groups := []; + svars := []; rvars := []; groups := []; vvars := []; exec_set_exp x +