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

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

(* Note:
     This module contains the generic tree walker, recursive
     application of optimization rules, and fix-point.

   - Gargi and Jerome
 *)

(* Type for rewriting rules *)

type rule =
    Xatenv.tenv -> Xquery_ast.cexpr -> Xquery_ast.cexpr * bool

(* Exception raised if a given rewriting rule does not apply *)

exception Not_applied

val generic_tree_apply   :
    Xatenv.tenv -> rule list -> Xquery_ast.cexpr -> (Xquery_ast.cexpr * bool)
val children_tree_apply  :
    Xatenv.tenv -> rule list -> Xquery_ast.cexpr -> (Xquery_ast.cexpr * bool)
val fix_point_tree_apply :
    Xatenv.tenv -> rule list -> Xquery_ast.cexpr -> Xquery_ast.cexpr

