Documentation ¶
Index ¶
Constants ¶
View Source
const ( NONE = "<NONE>" ANY = "<ANY>" )
Variables ¶
View Source
var ( SymbolAND = "&&" SymbolOR = "||" SymbolNOT = "!" )
View Source
var ( ErrEmptyUnion = stdErrors.New("no union items found") ErrEmptyIntersection = stdErrors.New("no intersection items found") )
Functions ¶
Types ¶
type BoolOperator ¶
type BoolOperator struct{}
type Logic ¶
type Logic[T Item] interface { fmt.Stringer Eval(o Operator[T]) (T, error) // contains filtered or unexported methods }
Logic represents a logical target which compile to (.. ∩ .. ∩ ..) ∪ (.. ∩ .. ∩ ..) ∪ (.. ∩ .. ∩ ..) ... It follows the rules below:
- A ∩ !A <=> 0
- A ∩ B <=> B ∩ A
- A ∪ B <=> B ∪ A
- (A ∩ B) ∩ C <=> A ∩ (B ∩ C)
- (A ∪ B) ∪ C <=> A ∪ (B ∪ C)
- A ∪ (B ∩ C) <=> (A ∪ B) ∩ (A ∪ C)
- A ∩ (B ∪ C) <=> (A ∩ B) ∪ (A ∩ C)
- A ∪ (A ∩ B) <=> A
- A ∩ (A ∪ B) <=> A
- !(A ∩ B) <=> !A ∪ !B
- !(A ∪ B) <=> !A ∩ !B
- A ∪ !A <=> 1
Click to show internal directories.
Click to hide internal directories.