(***********************************************************************)
(*                                                                     *)
(*                                 GALAX                               *)
(*                            XML Query Engine                         *)
(*                                                                     *)
(*  Copyright 2000, Lucent Technologies.                               *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)

(* $Id: optimjudge.mli,v 1.3 2003/01/10 18:41:53 simeon Exp $ *)

(*************************************************)
(* Auxiliary judgements used during the analysis *)
(*************************************************)

val used_count : Xquery_ast.vname -> Xquery_ast.cexpr -> int
    (* [used_count] determines the occurrence of variable $x in a
       given core expression *)

val can_fail : Xquery_ast.cexpr -> bool
    (* [can_fail] determines whether the given core expression can
       raise an error *)

(*
val is_ordered : Xquery_ast.cexpr -> bool
    (* [is_ordered] determines whether the given core expression is
       already sorted by document order or not *)
*)

val intersects : Xatenv.tenv -> Xquery_ast.model -> Xquery_ast.datatype -> bool

val does_node_care_about_order : Xquery_ast.cexpr -> bool

