Skip to content
docs
Arxo ↗

LDC-E2108 — Operands of incompatible kinds

For LLMs5 sections

Arithmetic and comparison work on matching kinds: adding a date to money, or ordering values that have no order, is rejected where it stands. The language performs no silent conversions between kinds — each operand must already be what the operation expects.

Rewriting the expression so both sides share a kind, or picking the operation that fits the kinds at hand, fixes it. The message names the two kinds found, which points straight at the side to change.

Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
relation out(x: Text, a: Money) kind institutional;
relation m(x: Text, a: Money) kind empirical;
relation d(x: Text, t: Date) kind empirical;
rule R strict { for x: Text; for a: Money; for t: Date; when m(x, a) and d(x, t); then out(x, (t + a)); }
Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
relation out(x: Text, a: Money) kind institutional;
relation m(x: Text, a: Money) kind empirical;
relation d(x: Text, t: Date) kind empirical;
rule R strict { for x: Text; for a: Money; for b: Money; when m(x, a) and m(x, b); then out(x, (a + b)); }

The engine reports this in its own wording:

Output
example.law:8:96: error LDC-E2108: «+»: incompatible kinds Date and Money — §58 requires matching kinds for addition and subtraction; the §49 scalar rule applies ONLY to multiplication (§48: no implicit conversions)

Documentation for Arxo. Writings — blog.arxo.io.

Anonymous visit counts on stats.arxo.io, no cookies.