1 Program trees🔗ℹ

(eval-tree tree env) -> real?

  tree : (or/c number? symbol? pair?)

  env  : (hash/c symbol? real?)

(tree-size tree) -> exact-nonnegative-integer?

(tree-depth tree) -> exact-nonnegative-integer?

A leaf is a number or a variable symbol; a branch applies a function from the registry to its evaluated children. The default registry is + - * and pdiv, division guarded against zero divisors — a search that wanders into a division by zero should pay a fitness price, not crash.