(*
This file is part of the dpll(t) engine sammy
Copyright (C) 2004  The University of Iowa
Cesare Tinelli

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*)

(** Maps the current state of the search (position in the search tree). *)

type state

val initial_state: state
(** The base state of the search. *)

val current_state: unit -> state
(** Current search position. *)

val current_level: unit -> int
(** Current level (depth) of the search. *)

val empty_level: unit -> int
(** Current lowest level. *)

val previous_state: int -> state
(** Next lower state. *)

val next: unit -> state
(** Next sequential state. *)

val is_valid: state -> bool
(** [State.is_valid s] compares state [s] with the current state, 
returning [true] if [s] is a state from a portion of the search space 
that still holds.  
It is used to determine if stored values are still fresh. *)

val backtrack: int -> unit
(** Backtrack n relative levels.*)

val backtrack_to_level: int -> unit
(** Backtrack to an absolute level. *)

val level : state -> int
(** [State.level s] returns the level of a [s]. *)

val advance_state : unit -> unit
(** Advances the empty_level boundary of the state one step *)

val retract_state : unit -> unit
(** Retracts the empty_level boundary of the state one step *)
