class School::BinaryPattern(F, A, B)

Overview

A pattern that matches a fact with two arguments.

Defined in:

school/rule/pattern.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class School::FactPattern

match(fact : Fact, bindings : Bindings) : Bindings | Nil
match(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

def self.new(fact_class : F.class, a : A, b : B) #

[View source]
def self.new(a : A, b : B) #

[View source]

Class Method Detail

def self.assert(a : F::A | Lit | Var, b : F::B | Lit | Var, bindings : Bindings) #

Asserts the associated Fact.


[View source]
def self.retract(a : F::A | Lit | Var, b : F::B | Lit | Var, bindings : Bindings) #

Retracts the associated Fact.


[View source]

Instance Method Detail

def a #

[View source]
def b #

[View source]
def match(fact : Fact, bindings : Bindings) : Bindings | Nil #

Indicates whether or not the fact matches the pattern.


[View source]
def vars : Enumerable(String) #

Returns the variables in the pattern.


[View source]