Commit 531994a4 authored by Pietro Abate's avatar Pietro Abate

[r2004-07-09 16:35:05 by cmiachon] Empty log message

Original author: cmiachon
Date: 2004-07-09 16:35:47+00:00
parent cda48a72
......@@ -673,13 +673,13 @@ let query_count = function
|_ -> assert false
let query_member e l = match l with
| Pair(i,p) ->
let query_member l = match l with
| Pair(e,p) ->
let rec aux l i = match l with
| Pair(j,r) -> if (compare i j =0) then vtrue else aux r i
| Atom a when a = Sequence.nil_atom -> vfalse
| _ -> assert false
in aux (Pair(i,p)) (e)
in aux p (e)
| Atom a when a = Sequence.nil_atom -> vfalse
|_ -> assert false
......@@ -688,7 +688,7 @@ let query_member e l = match l with
let query_distinct = function
| Pair(i,p) ->
let rec aux l1 l2 = match l1 with
| Pair(h,t) -> if (query_member h t)=vtrue
| Pair(h,t) -> if (query_member(Pair(h,t)))=vtrue
then (aux t l2) else (aux t (l2@[h]))
| Atom a when a = Sequence.nil_atom -> l2
| _ -> assert false
......@@ -699,4 +699,5 @@ let query_distinct = function
(* todo : typage precis pour min et max et distinct_values
*)
......@@ -125,5 +125,5 @@ val query_max: t-> t
val query_sum: t-> t
val query_avg: t-> t
val query_count: t-> t
val query_member: t->t -> t
val query_member: t -> t
val query_distinct: t -> t
......@@ -333,8 +333,8 @@ register_fun "count" Sequence.any int
(Value.query_count );;
binary_op_cst "member" any Sequence.any bool
register_fun "member" (Sequence.plus any) bool
(Value.query_member );;
register_fun "distinct_values" Sequence.any Sequence.any
register_fun "distinct_values" (Sequence.star any) Sequence.any
(Value.query_distinct );;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment