class School::UnaryPattern(F, C)

Overview

A pattern that matches a fact with one argument.

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, c : C) #

[View source]
def self.new(c : C) #

[View source]

Class Method Detail

def self.assert(c : F::C | Lit | Var, bindings : Bindings) #

Asserts the associated Fact.


[View source]
def self.retract(c : F::C | Lit | Var, bindings : Bindings) #

Retracts the associated Fact.


[View source]

Instance Method Detail

def c #

[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]