class School::BinaryPattern(F, A, B)
Overview
A pattern that matches a fact with two arguments.
Defined in:
school/rule/pattern.crConstructors
Class Method Summary
-
.assert(a : F::A | Lit | Var, b : F::B | Lit | Var, bindings : Bindings)
Asserts the associated
Fact
. -
.retract(a : F::A | Lit | Var, b : F::B | Lit | Var, bindings : Bindings)
Retracts the associated
Fact
.
Instance Method Summary
- #a
- #b
-
#match(fact : Fact, bindings : Bindings) : Bindings | Nil
Indicates whether or not the fact matches the pattern.
-
#vars : Enumerable(String)
Returns the variables in the pattern.
Instance methods inherited from class School::FactPattern
match(fact : Fact, bindings : Bindings) : Bindings | Nilmatch(bindings : Bindings, trace : TraceNode | Nil = nil, &block : Bindings -> Nil) : Nil match
Instance methods inherited from class School::BasePattern
match(bindings : Bindings, trace : TraceNode | Nil = nil, &block : Bindings -> Nil) : Nil
match,
to_s(io : IO)
to_s,
vars : Enumerable(String)
vars
Constructor Detail
Class Method Detail
Asserts the associated Fact
.
Retracts the associated Fact
.
Instance Method Detail
Indicates whether or not the fact matches the pattern.