Skip to main content
Skip to main content

Research / Engineering Blog / Evaluation

Why our classifier has three answers, not two

Caelex Engineering5 min read

A classifier that can only say yes or no has to guess when a fact is missing. Ours has a third answer, and a rule that an unknown can never count as a no.

The first version of any rule engine is boolean. A condition holds or it does not, a position applies or it does not. It takes about one afternoon with real datasheets to see why that is wrong for export control.

A datasheet rarely states every value a list position asks about. If a condition reads “resolution of 14 bit or more” and the datasheet says nothing about resolution, a boolean engine has two choices. It can treat the condition as false, or it can refuse to answer. The first choice is the dangerous one: the position is ruled out, the list comes back clean, and nobody ever looked.

Three values

So every condition in our evaluation has three possible values: met, refuted and open. The connectives are the ones Kleene described in 1952, and they fit in a few lines:

type V = 0 | 1 | null; // refuted, met, open

const and = (a: V, b: V): V =>
  a === 0 || b === 0 ? 0 : a === 1 && b === 1 ? 1 : null;

const or = (a: V, b: V): V =>
  a === 1 || b === 1 ? 1 : a === 0 && b === 0 ? 0 : null;

const not = (a: V): V => (a === null ? null : a === 1 ? 0 : 1);

A conjunction is refuted as soon as one part is refuted. It is met only when every part is met. One open part keeps the whole open. That is exactly how a careful person reads “all of the following”.

Unknown is not absent, and neither is a no

The rule that matters sits one level below, where a single condition meets the facts:

function evaluate(condition: Condition, facts: Facts): V {
  const fact = facts.get(condition.attribute);
  // Absent, or asked and answered "I do not know": both stay open.
  if (fact === undefined || fact.unknown) return null;
  return satisfies(fact, condition) ? 1 : 0;
}

Only a stated value can produce a refutation. We also keep “absent” and “unknown” apart in the data, although both evaluate to open. Absent means nobody was asked. Unknown means a person was asked and could not say, so the question is not put again and the record shows that it was asked.

What we test

The useful thing about writing the rule this way is that the safety property becomes a test, not a hope:

// For every position p, every set of facts F and every attribute a:
//   result(p, F) is "not listed"  =>  result(p, F + unknown(a)) is "not listed"
//   result(p, F) is open          =>  result(p, F + unknown(a)) is open
// An unknown never moves a position towards "not listed".

The second property we hold is stability. Once a position is met or refuted, adding facts does not change it. Only an open result can still move. That is what makes it safe to stop asking questions at some point, and it is why the list of open conditions is also the list of questions: nothing else can change the outcome.

The cost

Three values cost something. More results come back open than a boolean engine would return, and an open result is work for a person. We think that is the right trade. A wrong hit costs an afternoon. A wrong “not listed” is a shipment that should not have left. The formal version of this argument, with the proof, is in our papers Deterministic Classification and Law, Computed.

Code on this blog is illustrative. It shows a decision, not our implementation. Software is not legal advice.

Why our classifier has three answers, not two | Caelex — Regulatory OS for the orbital economy