RuleSet type (joe)


A Nero rule set, as created by the ruleset expression. A rule set contains Nero rules and optionally some number of base facts. A rule set can infer new facts given its rules, base facts, and any input facts provided by the script.

Methods

Methods


ruleSet.infer()


ruleSet.infer([inputs]) → Set

Returns a set of known facts, both input and inferred, given the rule set and any provided inputs.

NOTE: By default, a rule set cannot infer facts of the same types as the given inputs: infer(inputs) throws an error if any input fact's type name is the same as a relation used in one of the rule set's rule heads or axioms.

However, an export declaration can achieve the same effect. See the Nero tutorial for details.

ruleSet.isDebug()


ruleSet.isDebug() → Boolean

Returns the rule set's debug flag.

ruleSet.isStratified()


ruleSet.isStratified() → Boolean

Returns whether the rule set is stratified or not.

ruleSet.setDebug()


ruleSet.setDebug(flag)

Sets the rule set's debug flag. If enabled, infer() will output a detailed execution trace.

ruleSet.toString()


ruleSet.toString() → String

Returns the value's string representation.