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

(* $Id: norm_context.mli,v 1.2 2003/04/21 16:08:47 simeon Exp $ *)

(* Module Norm_context
   Description:
     This module implements the part of the context which is required
     during the normalization phase.
*)

(* Type for the normalization context *)

type norm_context 

(* Build a normalization context *)

val build_norm_context : Namespace.nsenv -> Schema.schema -> ((Xquery_ast.rfname * int) * (Xquery_ast.rfname * Xquery_ast.cfunction_signature)) list -> norm_context

(* Copy the entire norm context *)

val copy_norm_context : norm_context -> norm_context

(* Create copy of norm context, preserving the function signatures, using new namespace and schema envs. *)

val copy_norm_context_with_sigs : norm_context -> Namespace.nsenv -> Schema.schema -> norm_context

(* Add a list of function signatures to normalization context *)

val add_sigs_to_norm_context : norm_context -> ((Xquery_ast.rfname * int) * (Xquery_ast.rfname * Xquery_ast.cfunction_signature)) list -> norm_context

(* Extract components from normalization context *)

val nsenv_from_norm_context : norm_context -> Namespace.nsenv
val schema_from_norm_context : norm_context -> Schema.schema

(* Lookup a function's signatures in normalization context *)

val one_sig_from_norm_context : norm_context -> (Xquery_ast.rfname * int) -> Finfo.finfo -> Xquery_ast.cfunction_signature

