Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.policy-visualization

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/policy_visualization.clj2 definitions, 3 theorems

AHoF V53 Policy Visualization: render a learned policy by displaying, at each state, the greedy action -- the one with the maximal action value. Between two actions the greedy choice keeps the higher value: greedy-action-zero? q0 q1 = decide (q1 <= q0) greedy-value q0 q1 = if (q1 <= q0) then q0 else q1 (the larger value) over exact rationals. Proved native and axiom-free (preference, max value, switch). Requires audit/decide-nnrat-at-most, logic/if-data (both in the D63 checkpoint). Scope (measured by the kernel): this module has 3 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.policy-visualization` prints this classification.

policy-viz/greedy-action-zero?

DefinitionSource, line 40

policy-viz/greedy-action-zero? :
  (x₁ x₂ : ℚ≥0)
  → data/Bool

ℚ≥0 = nnrat/NonnegativeRational

policy-viz/greedy-value

DefinitionSource, line 45

policy-viz/greedy-value :
  (x₁ x₂ : ℚ≥0)
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

policy-viz/greedy-prefers-higher

TheoremWorked exampleNo axiomsSource, line 55

policy-viz/greedy-prefers-higher :
  → bo/is-safe 3/4 1/2 = data/true

= = equality/Eq

policy-viz/greedy-value-is-maximum

TheoremWorked exampleNo axiomsSource, line 61

policy-viz/greedy-value-is-maximum :
  → fsc/node-value 3/4 1/2 = 3/4

= = equality/Eq

policy-viz/greedy-switches

TheoremWorked exampleNo axiomsSource, line 67

policy-viz/greedy-switches :
  → bo/is-safe 1/2 3/4 = data/false

= = equality/Eq