Mathematical properties of a callable occurrence counter #
These proofs use the existing array-count function and standard list facts. They do not expand its traversal, registers or call frames. A decoded result is a mathematical observation of the actual function, not a new executable implementation. Each array is assumed to be present in memory already. The executable example passes the target as an ordinary additional argument; its complete count includes the actual function call and halt.
Counting is insensitive to the order of the represented words. The heaps and pointers may differ: this equates only returned counts, not shared states or the work of constructing or permuting either array.
Execute the declared counter with a typed array and a scalar target. The runner returns a value separately from the untouched output stream.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The real mixed-argument invocation returns the exact list count, with all call, iteration and halt instructions included. The represented length bounds the result, so the occurrence count cannot overflow a word.