#ifndef __IBOOLEAN__
#define __IBOOLEAN__
#include <iostream>

// IBOOLEAN is an interval Boolean. Used for a trivalued logic
// if x=[0,0]=ifalse  : certainly false
// if x=[0,1]=iperhaps: don't know
// if x=[1,1]=itrue  : certainly true
// Otherwise x=empty
enum IBOOLEAN {itrue, ifalse, iperhaps, empty};

class iboolean
{
public:
	IBOOLEAN value;
public:
	iboolean ();
	iboolean (bool);
	iboolean (IBOOLEAN);
	iboolean (const iboolean&);
	friend iboolean operator&& (iboolean, iboolean);
	friend iboolean operator|| (iboolean&, iboolean&);
	friend iboolean operator!  (iboolean&);
	friend bool		 operator== (iboolean, iboolean);
	friend bool		 operator!= (iboolean, iboolean);



        friend std::ostream& operator<< (std::ostream& os, const iboolean&);

};

iboolean Inter(iboolean,iboolean);
iboolean Not(iboolean x);
iboolean Union(iboolean, iboolean);
iboolean And(iboolean,iboolean);
iboolean Or(iboolean,iboolean);
iboolean leq(iboolean x, iboolean y);
iboolean geq(iboolean x, iboolean y);
iboolean Restrict(iboolean x, iboolean y);      // return x and !y
iboolean Xor(iboolean x, iboolean y);

#endif
