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

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.
*)

(** This contains descriptions of predicates, literals, and clauses. *)

type pred
type lit
(**********************)

(** {6 Predicates} *)

val new_pred : Global.pred_id -> string -> (*State.state ->*) bool -> bool -> 
               bool-> pred
(** [Pred.new_pred id form s abstr interp quant]
Returns a new predicate with id [id] and  name [form] at state [s].  
[abstr] indicates if the predicate is abstract, [interp] indicates if 
the predicate is interpreted by the theory, and [quant] indicates if it 
represents a quantified expression.
*)

val pred_status : pred -> Global.status
(** Returns the current status of the predicate.
This will be [Global.Undet] if its previous value is stale.
 *)

(*
val pred_set_status : pred -> State.state -> Global.status -> unit
(** Sets the status of the predicate indicated at the given state *)
*)

val is_abstract : pred -> bool
(** Returns [true] if pred is abstract *)

val is_interpreted : pred -> bool
(** Returns [true] if pred is to be interpreted by the theory *)

val formula : pred -> string
(** Returns the formula (name) string associated with this predicate. *)

val id : pred -> Global.pred_id
(** Returns the id associated with this predicate. *)

(*val state : pred -> State.state*)
(** Returns the state at which this predicate's status was last set. *)

val level : pred -> int
(** Returns the level at which this predicate's status was last set. *)

val is_universal: pred -> bool
(** Returns true if this predicate is universally quantified. *)

val set_universal: pred -> bool -> unit
(** Set whether this predicate is universally quantified. *)

val is_quantified_abstraction : pred -> bool
(** Returns [true] if this predicate is a quantified abstraction *)

val set_quantified_abstraction : pred -> bool -> unit
(** Sets the quantified_abstraction flag for a pred *)

val is_watched : pred -> bool
(** Returns [true] if this predicate is currently a watched literal *)

val set_interpreted: pred -> bool -> unit
(** Set whether this predicate is interpreted by the theory. *)

val get_score_and_status : pred -> (int * Global.status)
(** Returns the activity score and proposed status for this predicate. *)

val set_formula_depth: pred -> int -> unit
(** sets the formula depth of a predicate (where it first occurs in the nesting of subformulas -- this begins at max_int, and calls to this will only lower the value *)

val get_formula_depth : pred -> int
(** returns the min amount of subformula nesting this predicate occurs in *)

val is_guard : pred -> bool
(** returns [true] if this predicate is detected as an ITE guard *)

val set_guard : pred -> unit
(** sets this predicate as being detected as an ITE guard *)

val add_pred_label : pred -> Escjava_label.label -> unit
(** adds a label to the predicate *)

val get_preferred_polarity : pred -> Global.status
(** returns the preferred status of a predicate (Undet for no preference) *)

val set_preferred_polarity : pred -> Global.status -> unit
(** sets a predicate's preferred polarity *)

val pred_string : pred -> string
(** returns a string identifying this pred *)

(*
val status_string : pred -> string
(** returns a string indicating the stored status of this pred *)
*)

(**********************)

(** {6 Literals} *)

val new_pos_lit : pred -> lit
(** Returns a new positive literal from this predicate *)

val new_neg_lit : pred -> lit
(** Returns a new negative literal from this predicate *)

val lit_id : lit -> Global.pred_id
(** Returns the (signed) pred id associated with a literal *)

val is_positive : lit -> bool
(** Return [true] of this literal is positive *)

val pred : lit -> pred
(** Return the predicate associated with this literal *)

val lit_status : lit -> Global.status
(** Return a literal's status. *)

val lit_string : lit -> string
(** Return a string identifying this literal. *)

