Skip to content
docs
Arxo ↗

Find a minimal change of inputs

For LLMs7 sections

I want to find a minimal change of inputs.

Without cost, minimality is undefined. The solver requires a finite presented set and does not guess arbitrary facts.

Incorrect form
counterfactual MakeReady { target ready(); mutable ready; }
Arxo Law
language "law.core" version "0.2";
package recipe.m04 version "1.0.0";
namespace "urn:recipe:m-queries:04";
relation ready();
counterfactual MakeReady { target ready(); mutable ready; cost "urn:recipe:m-queries:04:unit-cost"; }
Input / variantQuestionExpectation
2. both ready supportstruth(ready())truth_status == BOTH; evaluation_status == COMPUTED;
1. original goal unknowntruth(ready())truth_status == NEITHER; evaluation_status == COMPUTED;
unknown initial goal
Arxo Law
test "unknown initial goal" {
given {
context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; }
}
evaluate truth(ready());
expect truth_status == NEITHER; expect evaluation_status == COMPUTED;
}

A contested proposition is checked separately with an ordinary truth query:

disputed goal stays both
Arxo Law
test "disputed goal stays both" {
given {
context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; }
assert ready(); assert not ready();
}
evaluate truth(ready());
expect truth_status == BOTH; expect evaluation_status == COMPUTED;
}

A separate finite set is presented to the solver. The program and case are taken from this test, programHash/caseHash and the input contentHash are pinned, and the ordinary counterfactual of both implementations is called to reproduce the certificate. This is a separate counterfactual interface, not a variety of truth in evaluates.

Set / input changeChecked solver result
empty: cost 0, no operations; b and a: cost 1, addAssertion ready()both equal minima, a and b in canonical order
empty onlyNO_SOLUTION
ready() already in the original caseALREADY_SATISFIED
not ready() in the case, candidate adds ready()NO_SOLUTION; targetStatus FALSE_ONLY of established(ready)
wrong programHash with recalculated contentHashCOUNTERFACTUAL_PROGRAM_HASH_MISMATCH
setContext legalTime, only mutable ready allowedrefusal of a forbidden mutation

The surface target ready() lowers into a status condition established(ready), so with two supports the raw truthStatus is BOTH (scene 2), while the certificate targetStatus is FALSE_ONLY. These are different questions, not a loss of positive support.

Cost is given as an exact Decimal string and belongs to the named model urn:recipe:m-queries:04:unit-cost; the adapter does not compute it. The set itself does not change the program and contains only operations over the input.

Check of result fields and extra inputs:

Python
>>> import runpy
>>> checks = runpy.run_path("docs/recipes/m-queries/resources/check.py")
>>> checks["counterfactual"](https://github.com/arxohq/law/blob/master/docs/recipes/m-queries/4)
True

The sidecar mutation reproduces LDC-E1205. Counterfactual table variants are executed separately; input errors are not passed off as NEITHER.

Counterfactual is a separate command and result type. Candidate worlds are presented as input; search does not promise a global minimum outside the set. The law, evidence, and the chosen reading are immutable.

Equal minima, cutoff, and Contradiction are checked separately; absence of cost must not be patched by an arbitrary default.

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

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