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

(* $Id: path_analysis.mli,v 1.1 2003/05/21 15:03:49 simeon Exp $ *)

(* Module: Path_analysis
   Description:
     This module implements the path analysis algorithm used by
     projection.
*)


open Path_struct
open Analysis_context


(* Applies final serialization operation on the path sequences *)

val serialize :
    rooted_path_sequence * rooted_path_sequence -> rooted_path_sequence


(* Core expression level path analysis *)

val cexpr_path_analysis :
    analysis_context ->
      Xquery_ast.cexpr -> rooted_path_sequence * rooted_path_sequence

val cexpr_path_analysis_optim :
    analysis_context ->
      Xquery_ast.cexpr ->
	rooted_path_sequence * rooted_path_sequence * Optim_vars.optim_vars


(* Query level path analysis *)

val query_path_analysis :
    Xquery_ast.cquery_module -> rooted_path_sequence

val query_path_analysis_optim :
    Xquery_ast.cquery_module -> rooted_path_sequence


(* Printing of analysis results *)

val print_intermediate_analysis :
    Format.formatter -> rooted_path_sequence * rooted_path_sequence -> unit

val print_full_analysis :
    Format.formatter -> rooted_path_sequence -> unit

