ch:semi-unification: ch:semi-unification
Problem and result. Represent finite arrow terms, replay ordinary equations under one outer substitution, and replay every inequality under that same outer substitution followed by its own matcher. Report rejection only with the displayed finite-tree certificate; bounded search exhaustion would be UNKNOWN.
Representation. Use algebraic trees for types and finite name–tree lists for substitutions. Store a matcher beside each inequality rather than in a single global field. Simultaneous substitution keeps the chapter equation
First complete version. Implement structural type equality, lookup, simultaneous substitution, and both replay clauses. Use the two-record input
Remaining cases. Add a list of several inequalities, keeping one matcher beside each entry. Recognize the exact syntax UNKNOWN when its fuel ends.
A failing version. Omitting application of the local matcher leaves the program check- and audit-clean but changes three inequality traces to FAILED and the two aggregate status lines to FAIL. This mutation detects the most important role confusion.
Acceptance test. Require the Bool equation, two inequalities with visibly distinct matchers, the verified symbolic node-count certificate, and the protected polymorphic-recursion replay. Require the exact four-case summary, mutation rejection, and an empty audit.
Mathematical boundary. Finite replay checks supplied certificates. It is not a decision procedure for semi-unification and proves neither the Henglein equivalence nor the Dudenhefner reduction.