ch:coinduction: ch:coinduction
Problem and result. Implement finite observation of a stream state machine in Kappa. The result prints the first ten Fibonacci values, confirms that depth nine takes nine state transitions, and rejects a mutated transition whose first two values are
Representation. Represent the infinite stream by a finite pair state and a transition function; represent an observation request by a natural depth. This mirrors the chapter’s corecursor and makes each consumed tail explicit. Storing a long finite list is simpler for one test but cannot express arbitrary finite observation or expose the transition invariant.
First complete version. Implement one Fibonacci transition
Remaining cases. Add a transition counter to verify the depth-nine request. Add the complete ten-value oracle
A failing version. Use the mutation
Acceptance test. Run the four commands in appendix E. Require the four exact observation and verdict lines, the final four-case summary, and an empty audit.
Mathematical boundary. The finite run checks the displayed observation equations. It does not prove the productivity theorem, coinduction, bisimulation soundness, or completeness of guardedness checking.