Documentation ¶
Index ¶
- type Algebra
- type Element
- type Parent
- func (B Parent) And(x object.Element, y object.Element) (object.Element, error)
- func (B Parent) AreEqual(x object.Element, y object.Element) (bool, error)
- func (B Parent) Cmp(x object.Element, y object.Element) (int, error)
- func (B Parent) Contains(x object.Element) bool
- func (B Parent) False() object.Element
- func (B Parent) IsFalse(x object.Element) (bool, error)
- func (B Parent) IsTrue(x object.Element) (bool, error)
- func (B Parent) Not(x object.Element) (object.Element, error)
- func (B Parent) Or(x object.Element, y object.Element) (object.Element, error)
- func (B Parent) String() string
- func (B Parent) ToElement(x object.Element) (object.Element, error)
- func (B Parent) True() object.Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algebra ¶
type Algebra interface { object.Parent True() object.Element // True returns the value corresponding to true. False() object.Element // False returns the value corresponding to false. IsTrue(x object.Element) (bool, error) // IsTrue returns true iff x is equal to the value corresponding to true. IsFalse(x object.Element) (bool, error) // IsFalse returns true iff x is equal to the value corresponding to false. And(x object.Element, y object.Element) (object.Element, error) // And returns the result x AND y. Or(x object.Element, y object.Element) (object.Element, error) // Or returns the result x OR y. Not(x object.Element) (object.Element, error) // Not returns the negation NOT x. }
Algebra is the interface satisfied by a boolean algebra.
type Element ¶
type Element bool
Element satisfies the object.Element interface.
func FromString ¶
FromString returns the boolean represented by the string s.
type Parent ¶
type Parent struct{}
Parent is the parent of a boolean element.
func (Parent) Cmp ¶
Cmp returns -1 if x is false and y is true, 0 if x == y, and +1 if x is true and y is false.
Click to show internal directories.
Click to hide internal directories.