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

(* $Id: xatenv.mli,v 1.6 2003/01/08 20:32:55 mff Exp $ *)

(* Type environment *)

type tenv

val addvar   : (tenv * Xquery_ast.vname * Xquery_ast.model)                        -> tenv
(* Extend type environment by adding mapping of (fname, arity) to (fname', signature) *)
val addfctn  : (tenv * (Xquery_ast.rfname * int) * (Xquery_ast.rfname * Xquery_ast.cfunction_signature)) -> tenv

(* Update type environment with mapping of (fname, arity) to (fname', signature) *)
val updatefctn  : (tenv * (Xquery_ast.rfname * int) * (Xquery_ast.rfname * Xquery_ast.cfunction_signature)) -> unit

(* Remove from type environment the current signature for (fname, arity)  *)
val removefctn  : (tenv * (Xquery_ast.rfname * int)) -> unit

val getvar   : (Finfo.finfo * tenv * Xquery_ast.vname)          -> Xquery_ast.model
val getfctn  : (Finfo.finfo * tenv * (Xquery_ast.rfname * int)) -> Xquery_ast.cfunction_signature

val get_allfctn  : (Finfo.finfo * tenv * (Xquery_ast.rfname * int)) -> (Xquery_ast.rfname * Xquery_ast.cfunction_signature) list

(* Global environment *)

val generate_tenv : Schema.schema -> Xquery_ast.cquery_module -> tenv
val generate_tenv_with_tenv : tenv -> Schema.schema -> Xquery_ast.cquery_module -> tenv

val schemaenv     : tenv -> Schema.schema

