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

(* $Id: maputil.mli,v 1.18 2003/04/16 19:52:47 mff Exp $ *)

open Xquery_ast

val forward_axis : axis -> bool

(*************************************************************)
(* this interface contains functions for mapping Full XQuery *)
(* expressions to the Core XQuery expression. For each Full  *)
(* XQuery expression, this inteface will have a mapping      *)
(* function defined, ie. its mapping rule.                   *)
(*************************************************************)

val map_binary_operator : binop -> cexpr -> cexpr -> expr_handle -> Finfo.finfo -> cexpr 
val map_unary_operator  : rfname -> cexpr -> expr_handle -> Finfo.finfo -> cexpr 
val map_function_app    : Norm_context.norm_context -> rfname -> cexpr list -> expr_handle -> Finfo.finfo -> cexpr

val map_to_flwr    : cexpr list -> cexpr option -> order_by option -> cexpr -> expr_handle -> Finfo.finfo -> cexpr

val map_to_CEIf      : cexpr -> cexpr -> cexpr -> expr_handle -> Finfo.finfo -> cexpr
val map_to_CESome    : datatype option -> vname -> cexpr -> cexpr -> expr_handle -> Finfo.finfo -> cexpr
val map_to_CEEvery   : datatype option -> vname -> cexpr -> cexpr -> expr_handle -> Finfo.finfo -> cexpr
val map_to_sequence  : expr_handle -> Finfo.finfo  -> cexpr list -> cexpr

val atomization               	: cexpr -> expr_handle -> Finfo.finfo -> cexpr 
val map_predicate_truth_value 	: cexpr -> cexpr -> expr_handle -> Finfo.finfo -> cexpr
val map_effective_boolean_value : cexpr -> expr_handle -> Finfo.finfo -> cexpr

val map_to_cast : cexpr -> Xquery_ast.model -> expr_handle -> Finfo.finfo -> cexpr
val map_to_castable : cexpr -> Xquery_ast.model -> expr_handle -> Finfo.finfo -> cexpr

(* Generate new variable name and variable expression *)
val gen_new_var_expr : expr_handle -> Finfo.finfo -> (vname * cexpr)

