rocq/theories/Transport.v
Transport between Prolog terms and the model: decoding a checked module that nanofil printed (nanofiloutcomes FILE, main.pl's outcomes/3) into the syntax of Syntax.v, and encoding the model's outcome as the term interp:run/5 would give, so the two can be compared with ==.
Decoding is partial in one deliberate way: a function that uses anything outside the core subset (a vector class, store, cas, setjmp, asm_fixed, touch ...) decodes to IOutsideName Term. It keeps its address and its term (the validator reads its signature), so calls to it and pointers to it behave as the interpreter's do, but running it is stuck.
String equality, written as Prolog's ==.
Decoding
The integer the term t is.
The name of the atom t.
The elements of the list t.
The arguments of t when it is the compound f/n.
The name of the temporary tmp(N).
An IR value: a temporary, an integer constant, or a global symbol.
The access rights read or write.
The bound a half check tests: upper or lower.
A narrow integer width with its signedness: sw, uw, sh, uh, sb or ub (signed or unsigned word, half or byte).
The type a raw load reads: l, s, d, x, or a narrow width.
A comparison's condition: equality, signed and unsigned integer order, float order, and whether two floats are ordered or not.
A list of memory effects.
An Op of ir.pl's table, in the core subset: arithmetic, conversions, comparisons, checks, raw loads and the rest.
An argument of a flight: address(V), a pointer's address, or a plain value.
A flight's capability source: none, or lower(V), the lower of the pointer V.
One result result(tmp(D), K) of a call: the temporary it binds and its class.
How a call reads its result: void, a tuple of results, or one result.
A call argument arg(K, V): a value and its class.
A list of call arguments.
An instruction of the core subset; None for any other.
A jump target: poll(L), a poll edge to L, or a plain label.
The jump that ends a block: goto, branch, return of one or several values or of none, or unreachable.
One L − V pair of a phi: a predecessor's label and the value for the edge from it.
A phi phi(tmp(D), K, Pairs).
A block block(L, Phis, Insts, Jump), every part decoded.
A parameter param(K, tmp(D)): its class and temporary.
A function from the arguments of its func(N, Lk, R, Ps, Bs) term; None if any part is outside the core subset.
An item's linkage; one the model does not know is kept as its term.
One item of a data object: a string of bytes, a pointer to a symbol plus an offset, a constant of a width, or zero bytes; any other is kept as its term.
An item of the module: a function, outside the core subset if dfunc fails, data or an alias; Some None for an explanatory context(_, _) item (context).
The module module(Items), its context items dropped.
Encoding
A capability as the interpreter writes it: none, obj(B), ro(B), fn(F) or ext(N).
A word as the interpreter writes it: an integer, ptr(Addr, Cap) or limit(Cap, Size).
A trap reason as the interpreter writes it, an atom, or early(R) and ahead(R) around another.
The outcome as interp:run/5 writes it.
Judging a line
The run halted because it left the core subset.
The model the gates run: the driver with the interpreter's runtime (DriverInterpRuntime).
The model's run of the module md on one outcome(Fn, Args, Fuel, Outcome) or error(Fn, Args, Fuel, E) line that outcomes/3 printed, compared with the interpreter's:
| Judgment | Means |
|---|---|
agree(Outcome) | the model and the interpreter have the same outcome |
disagree(Model, Prolog) | they differ: a finding, presumed the model's fault |
outside(Fn, Why) | the run leaves the core subset, so it is not compared |
stuck_both(Fn, Why) | the interpreter threw or failed, and the model is stuck too |
The module with its item at index i (0-based, without contexts) replaced by the items xs: none deletes it, one replaces it, the new item and then the old one insert before it.
The term t mentions global(N), for the name n.
Whether two function signatures are the same: parameters, return and variadicity.
A mutant f of the function fn that changes its signature, in a module md where a function outside the core subset refers to it: what that function may now pass or read cannot be judged by the model.
The name an item defines.
A change, removing the items olds and adding news, to a data object or an alias that a function outside the core subset refers to by the old or the new name: whether that function is still valid cannot be judged by the model.
The model's validator on one verdict(Name, At, Id, Change, V) line that rocq/mutants.pl printed, compared with ir:valid_module/1's verdict V. It makes the Change, replace(Item), delete or insert(Item) before it, to the module's item at index At, and judges valid_items of the whole module (a mutant can change what its callers may pass it): agree(Name, Id, V), disagree(Name, Id, Model, Prolog) or outside(Name, Id). A mutant is outside when it is outside the core subset, when it changes a function's signature and a function outside the subset refers to it, or when it changes data or an alias that a function outside the subset refers to by name.