Section "adaption"

The Dogelog Player Prolog system can measure the Prolog system execution time between two GC minor, by subtracting all asynchronous wait through its ‘$YIELD’ instruction and through its auto-yield. Currently the read operations are async and correctly accounted, while the write operation are sync and might skew the result:

t_m: The measured time between two time slots.
t_d: The desired time between two time slots.

In the case of GC minor t_d is 1000 ms. If t_m < t_d then GC_MAX_INFERS needs to be in-creased. We implemented a formula that adapts the constant. A proportional update is justified, since t_m is measured between time slots derived from inference counting and the con-stant. The formula reads as follows:

GC_MAX_INFERS’ := GC_MAX_INFERS * t_d / t_m

The problem is, that it can lead to erratic behaviour, since inference counting does not exactly proportionate time. For example, a unification might take more time for larger Prolog terms. Therefore, we also introduced some damping in the form of taking a weighted mean. The Prolog system currently uses α = ¼ across all targets:

GC_MAX_INFERS’’ := α*GC_MAX_INFERS’ + (1-α)*GC_MAX_INFERS