5 Rules engines and APIs - Rules-as-Code-League/RaC-Handbook GitHub Wiki

What is a Rules Engine?

A ‘rules engine’ or ‘logic engine’ is a piece of software that applies a 'rule base' to facts or inputs, and conducts logical reasoning.

A 'rule base' is a collection of rules and facts that can be consumed by a rules engine.

In summary, a rules engine answers queries, which are usually questions in the form of "is this true" have regard to a specific rule and fact, or "with regard to what data in the rule base is this true"?

For example, if a person is eligible for a rebate if they are 18 years of age are older, the question might be "is the person eligible for a rebate?", if the person is over the age of 18. This could be expressed (in pseudocode) as follows:

Person is eligible = TRUE

IF

Person is at least 18 years of age = TRUE

Rules Engine options

The following rules engines have been identified as potentially useful for Rules As Code:

A longer list of rule engines can be found in the Wikipedia article Semantic Reasoner.

All of these technologies remain to be evaluated under a variety of RaC requirements, such as

  • suitability for embedding into a web application
    • as a front-end Javascript app
    • as a back-end traditional web app
    • as a set of APIs
  • expressiveness (forward-chaining? Backward-chaining?) and tractability
  • tooling support (IDEs? Import/Export?)

Jason Morris's LLM thesis (Nov 2019) contains just such a survey.

Closely associated with rules engines are ontology management systems:

The Object Management Group champions a number of standards which may be relevant:

Other standards for rules include:

See discussion of the Symbol Management Problem by Dorian Taylor; it offers a perspective on the history of Semantic Web and how it is relevant today. Integration with Semantic Web is attractive because it suggests the possibility of reusing an existing ontology, so that we don't have to reinvent the wheel. Possible existing ontologies include

However, we may discover that for the purposes of RaC, a sovereign jurisdiction needs to roll its own ontology, because that degree of precision is essential to the notion of sovereignty. In that case, something like LKIF might make more sense.

A number of research projects are underway in the field of computational law and rules-as-code:

  • Legalese.com's L4 language, under construction, aims to support expression and reasoning but also natural language generation, hence isomorphism.
  • Accord Project has put forward a simplified schema language called Concerto, for smart contracts.