use crate::boolean::*;
use crate::cmp;
use crate::conditional::*;
pub trait NAnd<B: Boolean> {
type Output: Boolean;
}
impl<B1, B2> NAnd<B1> for B2
where
B1: Boolean,
B2: Boolean,
<B1 as Boolean>::Value: cmp::PeanoEq<B2>,
<B1 as Boolean>::Value: cmp::PeanoEq<<B2 as Boolean>::Value>,
<<B1 as Boolean>::Value as cmp::PeanoEq<<B2 as Boolean>::Value>>::Output:
Conditional<False, True>,
<<<B1 as Boolean>::Value as cmp::PeanoEq<<B2 as Boolean>::Value>>::Output as Conditional<
False,
True,
>>::Output: Boolean,
{
type Output = crate::condition!(
<B1::Value as cmp::PeanoEq<B2::Value>>::Output => False | True
);
}
pub trait Not {
type Output: Boolean;
}
pub trait And<B: Boolean> {
type Output: Boolean;
}
pub trait Or<B: Boolean> {
type Output: Boolean;
}
pub trait Xor<B: Boolean> {
type Output: Boolean;
}
impl And<False> for False {
type Output = False;
}
impl And<True> for False {
type Output = False;
}
impl And<False> for True {
type Output = False;
}
impl And<True> for True {
type Output = True;
}
impl Or<False> for False {
type Output = False;
}
impl Or<True> for False {
type Output = True;
}
impl Or<False> for True {
type Output = True;
}
impl Or<True> for True {
type Output = True;
}
impl Not for True {
type Output = False;
}
impl Not for False {
type Output = True;
}
impl Xor<False> for False {
type Output = False;
}
impl Xor<True> for True {
type Output = False;
}
impl Xor<False> for True {
type Output = True;
}
impl Xor<True> for False {
type Output = True;
}