X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmathql_interpreter%2Fintersect.ml;h=8a2f55ff224cec02d1392560c171af73eca81e9d;hb=4ac188650f64fb947c5d87dcf3c932a4d013d842;hp=e56d1d1f35b2c40ca06473efb32a3a6804f8060b;hpb=39cbf1a39c008ac738b121178a5110cafd8c6ffa;p=helm.git diff --git a/helm/ocaml/mathql_interpreter/intersect.ml b/helm/ocaml/mathql_interpreter/intersect.ml index e56d1d1f3..8a2f55ff2 100644 --- a/helm/ocaml/mathql_interpreter/intersect.ml +++ b/helm/ocaml/mathql_interpreter/intersect.ml @@ -23,7 +23,6 @@ * http://cs.unibo.it/helm/. *) -exception NotCompatible;; (* Catenates two lists preserving order and getting rid of duplicates *) let rec append (l1,l2) = @@ -48,7 +47,7 @@ let rec sum_groups(gr1, gr2) = ;; -(* Product between an attribute set and a gropu of attributes *) +(* Product between an attribute set and a group of attributes *) let rec sub_prod (aset, gr) = (*prende un aset e un gr e fa la somma tra tutti i gruppi di aset e gr *) match aset with [] -> [] @@ -70,10 +69,10 @@ let intersect_ex rs1 rs2 = match (rs1, rs2) with [],_ | _,[] -> [] - | (uri1,as1)::tl1, - (uri2,as2)::_ when uri1 < uri2 -> intersect_aux tl1 rs2 - | (uri1,as1)::_, - (uri2,as2)::tl2 when uri2 < uri1 -> intersect_aux rs1 tl2 + | (uri1,_)::tl1, + (uri2,_)::_ when uri1 < uri2 -> intersect_aux tl1 rs2 + | (uri1,_)::_, + (uri2,_)::tl2 when uri2 < uri1 -> intersect_aux rs1 tl2 | (uri1,as1)::tl1, (uri2,as2)::tl2 -> (uri1, prod(as1,as2))::intersect_aux tl1 tl2 in