propeller.problems.PSB2.luhn

LUHN from PSB2

Given a vector of 16 digits, implement Luhn’s algorithm to verify a credit card number, such that it follows the following rules: double every other digit starting with the second digit. If any of the results are over 9, subtract 9 from them. Return the sum of all of the new digits.

Source: https://arxiv.org/pdf/2106.06086.pdf

-main

(-main & args)

Runs the top-level genetic programming function, giving it a map of arguments with defaults that can be overridden from the command line or through a passed map.

error-function

(error-function argmap data individual)

Finds the behaviors and errors of an individual: Error is 0 if the value and the program’s selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.

instructions

Stack-specific instructions, input instructions, close, and constants

random-int

(random-int)

Random integer between -100 and 100

train-and-test-data