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

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

(* global_id.ml *)

(** Data types and utility functions for id values. *)

type pred_id = int
type term_id = int
type var_id = int
type type_id = int

(* pred_id manipulations *)
let id_compare = compare
let compl (n:pred_id) = n lxor 1
let is_positive (n:pred_id) = (n land 1 = 1)
let is_negative (n:pred_id) = (n land 1 = 0)
let unsigned (n:pred_id) = n lor 1
let id_string i = string_of_int i

let sid_string i =
  if is_positive i then 
    string_of_int ((i lsr 1))
  else 
    string_of_int ((-(i lsr 1)))

