Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.grammatical-evolution

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

AHoF O71 Grammatical Evolution: evolve programs by mapping integer genomes through a BNF grammar, then select by fitness; between two individuals it keeps the fitter one: prefers-fitter? f0 f1 = decide (f1 <= f0) best-fitness f0 f1 = if (f1 <= f0) then f0 else f1 (the higher fitness) over exact rationals. Proved native and axiom-free: the preference decision, the max fitness, and the switch when the second individual is fitter. 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.grammatical-evolution` prints this classification.

grammar-evo/prefers-fitter?

DefinitionSource, line 40

grammar-evo/prefers-fitter? :
  (x₁ x₂ : ℚ≥0)
  → data/Bool

ℚ≥0 = nnrat/NonnegativeRational

grammar-evo/best-fitness

DefinitionSource, line 45

grammar-evo/best-fitness :
  (x₁ x₂ : ℚ≥0)
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

grammar-evo/prefers-fitter-example

TheoremWorked exampleNo axiomsSource, line 55

grammar-evo/prefers-fitter-example :
  → bo/is-safe 3/4 1/2 = data/true

= = equality/Eq

grammar-evo/best-fitness-is-maximum

TheoremWorked exampleNo axiomsSource, line 61

grammar-evo/best-fitness-is-maximum :
  → fsc/node-value 3/4 1/2 = 3/4

= = equality/Eq

grammar-evo/switches-individual

TheoremWorked exampleNo axiomsSource, line 67

grammar-evo/switches-individual :
  → bo/is-safe 1/2 3/4 = data/false

= = equality/Eq