Rete.IR.CompoundNegation (Rete v0.1.0)

Copy Markdown View Source

The negation of a conjunction: "no match satisfies all of these at once".

Never de Morganed, because the conjuncts share existentially quantified variables. {:nand, [{:order, x}, {:refund, x}]} means "there is no x with both", while the de Morganed form means "there are no orders at all, or no refunds at all", which is false whenever one x has an order and a different x has a refund.

Rete.Compiler.Negation extracts it into a helper production whose RHS inserts a marker fact. Nothing else in the pipeline can evaluate one. It binds nothing downstream, but its inner conditions are still classified, because the helper needs their join keys.

Summary

Types

t()

@type t() :: %Rete.IR.CompoundNegation{conditions: [Rete.IR.condition()]}