UOR Bounded Recursion

IRI
https://uor.foundation/recursion/
Prefix
recursion:
Space
kernel
Comment
Self-referential computations with well-founded descent measures guaranteeing termination.

Imports

  • https://uor.foundation/op/
  • https://uor.foundation/schema/
  • https://uor.foundation/predicate/
  • https://uor.foundation/morphism/
  • https://uor.foundation/effect/
  • https://uor.foundation/failure/
  • https://uor.foundation/trace/

Classes

NameIRISubclass OfDisjoint WithComment
BoundedRecursionhttps://uor.foundation/recursion/BoundedRecursionhttp://www.w3.org/2002/07/owl#ThingA self-referential computation parameterized by a descent measure. Each recursive step strictly decreases the measure; the computation terminates when the base case predicate is satisfied.
DescentMeasurehttps://uor.foundation/recursion/DescentMeasurehttp://www.w3.org/2002/07/owl#ThingA well-founded function from computation state to xsd:nonNegativeInteger. Strictly decreases on every recursive step.
BaseCasehttps://uor.foundation/recursion/BaseCasehttps://uor.foundation/predicate/MatchArmThe match arm selected when the descent measure reaches zero or the base predicate is satisfied. Produces a direct result without further recursion.
RecursiveCasehttps://uor.foundation/recursion/RecursiveCasehttps://uor.foundation/predicate/MatchArmThe match arm selected when the descent measure is positive. Applies a decomposition step, decreases the measure, and invokes the recursion.
RecursiveStephttps://uor.foundation/recursion/RecursiveStephttp://www.w3.org/2002/07/owl#ThingA single step in a bounded recursion: the decomposition applied before the recursive invocation. Must strictly decrease the DescentMeasure.
RecursionTracehttps://uor.foundation/recursion/RecursionTracehttps://uor.foundation/trace/ComputationTraceA computation trace recording the sequence of recursive steps, measure values, and the base case result. The trace length is bounded by the initial measure value.
StructuralRecursionhttps://uor.foundation/recursion/StructuralRecursionhttps://uor.foundation/recursion/BoundedRecursionA bounded recursion where the descent measure is the structural size of the input type (site count, constraint count, or operad nesting depth).

Properties

NameKindFunctionalDomainRangeComment
measureObjecttruehttps://uor.foundation/recursion/BoundedRecursionhttps://uor.foundation/recursion/DescentMeasureThe descent measure guaranteeing termination.
baseCaseObjecttruehttps://uor.foundation/recursion/BoundedRecursionhttps://uor.foundation/recursion/BaseCaseThe base case match arm.
recursiveCaseObjecttruehttps://uor.foundation/recursion/BoundedRecursionhttps://uor.foundation/recursion/RecursiveCaseThe recursive case match arm.
stepDecompositionObjecttruehttps://uor.foundation/recursion/RecursiveStephttps://uor.foundation/morphism/TransformThe transform applied to decompose the input before recursion.
stepMeasurePreObjecttruehttps://uor.foundation/recursion/RecursiveStephttps://uor.foundation/recursion/DescentMeasureThe measure value before this step.
stepMeasurePostObjecttruehttps://uor.foundation/recursion/RecursiveStephttps://uor.foundation/recursion/DescentMeasureThe measure value after this step.
basePredicateObjecttruehttps://uor.foundation/recursion/BoundedRecursionhttps://uor.foundation/predicate/PredicateThe predicate that identifies the base case.
recursionBodyObjecttruehttps://uor.foundation/recursion/BoundedRecursionhttps://uor.foundation/morphism/ComputationDatumThe computation applied at each recursive step (may reference itself via its content address).
initialMeasureDatatypetruehttps://uor.foundation/recursion/BoundedRecursionhttp://www.w3.org/2001/XMLSchema#nonNegativeIntegerThe measure value at the start of recursion. Bounds the maximum recursion depth.
measureValueDatatypetruehttps://uor.foundation/recursion/DescentMeasurehttp://www.w3.org/2001/XMLSchema#nonNegativeIntegerThe current value of the descent measure.