Documentation ¶
Index ¶
- Constants
- 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 ¶
View Source
const ( ErrArgNotABoolean = objectError(iota) ErrArg1NotABoolean ErrArg2NotABoolean )
Common errors.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algebra ¶
type Algebra interface { object.Parent // True returns the value corresponding to true. True() object.Element // False returns the value corresponding to false. False() object.Element // IsTrue returns true iff x is equal to the value corresponding to true. IsTrue(x object.Element) (bool, error) // IsFalse returns true iff x is equal to the value corresponding to false. IsFalse(x object.Element) (bool, error) // And returns the result x AND y. And(x object.Element, y object.Element) (object.Element, error) // Or returns the result x OR y. Or(x object.Element, y object.Element) (object.Element, error) // Not returns the negation NOT x. Not(x object.Element) (object.Element, error) }
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.