diff --git a/docs/A_Guide_To_Propeller.html b/docs/A_Guide_To_Propeller.html index 91402e7..27abe56 100644 --- a/docs/A_Guide_To_Propeller.html +++ b/docs/A_Guide_To_Propeller.html @@ -1,6 +1,6 @@ -A Guide to Propeller

A Guide to Propeller

+A Guide to Propeller

A Guide to Propeller

Propeller is an implementation of the Push programming language and the PushGP genetic programming system in Clojure.

For more information on Push and PushGP see http://pushlanguage.org.

Overview

diff --git a/docs/Additional_Instructions.html b/docs/Additional_Instructions.html new file mode 100644 index 0000000..ebe5251 --- /dev/null +++ b/docs/Additional_Instructions.html @@ -0,0 +1,132 @@ + +input_output.cljc

Bool, Char, Code, Input-Output, Numeric, and String Instructions

+

input_output.cljc

+

:print_newline

+

Prints new line

+

numeric.cljc

+

:float_cos

+

Pushes the cosine of the top FLOAT

+

:float_sin

+

Pushes the sine of the top FLOAT

+

:float_tan

+

Pushes the tangent of the top FLOAT

+

:float_from_integer

+

Pushes the floating point version of the top INTEGER

+

:integer_from_float

+

Pushes the result of truncating the top FLOAT towards negative infinity

+

string.cljc

+

:string_butlast

+

Pushes the butlast of the top STRING (i.e. the string without its last letter)

+

:string_concat

+

Pushes the concatenation of the top two STRINGs (second + first)

+

:string_conj_char

+

Pushes the concatenation of the top STRING and the top CHAR (STRING + CHAR)

+

:string_contains

+

Pushes TRUE if the top STRING is a substring of the second STRING, and FALSE otherwise

+

:string_contains_char

+

Pushes TRUE if the top CHAR is contained in the top STRING, and FALSE otherwise

+

:string_drop

+

Pushes the top STRING with n characters dropped, where n is taken from the top of the INTEGER stack

+

:string_empty_string

+

Pushes TRUE if the top STRING is the empty string

+

:string_first

+

Pushes the first CHAR of the top STRING

+

:string_from_boolean

+

Pushes the STRING version of the top BOOLEAN, e.g. “true”

+

:string_from_char

+

Pushes the STRING version of the top CHAR, e.g. “a”

+

:string_from_float

+

Pushes the STRING version of the top FLOAT e.g. “2.05”

+

:string_from_integer

+

Pushes the STRING version of the top INTEGER, e.g. “3”

+

:string_indexof_char

+

Pushes the index of the top CHAR in the top STRING onto the INTEGER stack. If the top CHAR is not present in the top string, acts as a NOOP

+

:string_iterate

+

Iterates over the top STRING using code on the EXEC stack

+

:string_last

+

Pushes the last CHAR of the top STRING. If the string is empty, do nothing

+

:string_length

+

Pushes the length of the top STRING onto the INTEGER stack

+

:string_nth

+

Pushes the nth CHAR of the top STRING, where n is taken from the top of the INTEGER stack. If n exceeds the length of the string, it is reduced modulo the length of the string

+

:string_occurencesof_char

+

Pushes the number of times the top CHAR occurs in the top STRING onto the INTEGER stack

+

:string_parse_to_chars

+

Splits the top string into substrings of length 1 (i.e. into its component characters) and pushes them back onto the STRING stack in the same order

+

:string_remove_char

+

Pushes the top STRING, with all occurrences of the top CHAR removed

+

:string_replace

+

Pushes the third topmost STRING on stack, with all occurences of the second topmost STRING replaced by the top STRING

+

:string_replace_char

+

Pushes the top STRING, with all occurences of the second topmost CHAR replaced with the top CHAR

+

:string_replace_first

+

Pushes the third topmost STRING on stack, with the first occurence of the second topmost STRING replaced by the top STRING

+

:string_replace_first_char

+

Pushes the top STRING, with the first occurence of the second topmost CHAR replaced with the top CHAR

+

:string_rest

+

Pushes the rest of the top STRING (i.e. the string without its first letter)

+

:string_reverse

+

Pushes the reverse of the top STRING

+

:string_set_char

+

Pushes the top STRING, with the letter at index n (where n is taken from the INTEGER stack) replaced with the top CHAR. If n is out of bounds, it is reduced modulo the length of the string

+

:string_split

+

Splits the top STRING on whitespace, and pushes back the resulting components in the same order

+

:string_substr

+

Pushes the substring of the top STRING, with beginning and end indices determined by the second topmost and topmost INTEGERs respectively. If an index is out of bounds, the beginning/end of the string is used instead

+

:string_take

+

Pushes the substring of the top STRING consisting of its first n letters, where n is determined by the top INTEGER

+

character.cljc

+

:char_is_letter

+

Pushes TRUE onto the BOOLEAN stack if the popped character is a letter

+

:char_is_digit

+

Pushes TRUE onto the BOOLEAN stack if the popped character is a digit

+

:char_is_whitespace

+

Pushes TRUE onto the BOOLEAN stack if the popped character is whitespace (newline, space, or tab)

+

:char_from_float

+

Pops the FLOAT stack, converts the top item to a whole number, and pushes its corresponding ASCII value onto the CHAR stack. Whole numbers larger than 128 will be reduced modulo 128. For instance, 248.45 will result in x being pushed.

+

:char_from_integer

+

Pops the INTEGER stack and pushes the top element’s corresponding ASCII value onto the CHAR stack. Integers larger than 128 will be reduced modulo 128. For instance, 248 will result in x being pushed

+

:char_all_from_string

+

Pops the STRING stack and pushes the top element’s constituent characters onto the CHAR stack, in order. For instance, “hello” will result in the top of the CHAR stack being \h \e \l \l \o

+

bool.cljc

+

:boolean_and

+

Pushes the logical AND of the top two BOOLEANs

+

:boolean_or

+

Pushes the logical OR of the top two BOOLEANs

+

:boolean_not

+

Pushes the logical NOT of the top BOOLEAN

+

:boolean_xor

+

Pushes the logical XOR of the top two BOOLEAN

+

:boolean_invert_first_then_and

+

Pushes the logical AND of the top two BOOLEANs, after applying NOT to the first one

+

:boolean_invert_second_then_and

+

Pushes the logical AND of the top two BOOLEANs, after applying NOT to the second one

+

:boolean_from_float

+

Pushes FALSE if the top FLOAT is 0.0, and TRUE otherwise

+

:boolean_from_integer

+

Pushes FALSE if the top INTEGER is 0, and TRUE otherwise

+

code.cljc

+

:code_append

+

Concatenates the top two instructions on the :code stack and pushes the result back onto the stack

+

:exec_do_range

+

Executes the top EXEC instruction (i.e. loops) a number of times determined by the top two INTEGERs, while also pushing the loop counter onto the INTEGER stack. The top INTEGER is the “destination index” and the second INTEGER is the “current index”. If the integers are equal, then the current index is pushed onto the INTEGER stack and the code (which is the “body” of the loop) is pushed onto the EXEC stack for subsequent execution. If the integers are not equal, then the current index will still be pushed onto the INTEGER stack but two items will be pushed onto the EXEC stack - first a recursive call to :exec_do_range (with the same code and destination index, but with a current index that has been either incremented or decremented by 1 to be closer to the destination index) and then the body code. Note that the range is inclusive of both endpoints a call with integer arguments 3 and 5 will cause its body to be executed 3 times, with the loop counter having the values 3, 4, and 5. Note also that one can specify a loop that “counts down” by providing a destination index that is less than the specified current index.

+

:exec_do_count

+

Executes the top EXEC instruction (i.e. loops) a number of times determined by the top INTEGER, pushing an index (which runs from 0 to one less than the total number of iterations) onto the INTEGER stack prior to each execution of the loop body. If the top INTEGER argument is <= 0, this becomes a NOOP

+

:exec_do_times

+

Like :exec_do_count, but does not push the loop counter onto the INTEGER stack

+

:exec_if

+

If the top BOOLEAN is TRUE, removes the the second item on the EXEC stack, leaving the first item to be executed. Otherwise, removes the first item, leaving the second to be executed. Acts as a NOOP unless there are at least two items on the EXEC stack and one item on the BOOLEAN stack

+

:exec_when

+

If the top BOOLEAN is TRUE, leaves the first item on the EXEC stack to be executed. Otherwise, it removes it. Acts as a NOOP unless there is at least one item on the EXEC stack and one item on the BOOLEAN stack

+

:exec_while

+

Keeps executing the top instruction on the EXEC stack while the top item on the BOOLEAN stack is true

+

:exec_do_while

+

Keeps executing the top instruction on the EXEC stack while the top item on the BOOLEAN stack is true. Differs from :exec_while in that it executes the top instruction at least once

+

:exec_k

+

The “K combinator” - removes the second item on the EXEC stack

+

:exec_s

+

The “S combinator” - pops 3 items from the EXEC stack, which we will call A, B, and C (with A being the first one popped), and then pushes a list containing B and C back onto the EXEC stack, followed by another instance of C, followed by another instance of A

+

:exec_y

+

The “Y combinator” - inserts beneath the top item of the EXEC stack a new item of the form “(:exec_y TOP_ITEM)”

+
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 23126c4..6c9d05a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,6 +1,6 @@ -Propeller 0.3.0

Propeller 0.3.0

Released under the EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0

Yet another Push-based genetic programming system in Clojure.

Installation

To install, add the following dependency to your project or build file:

[net.clojars.lspector/propeller "0.3.0"]

Topics

Namespaces

propeller.genome

The genetic material in Propeller. A plushy is a list of Push instructions that represent a Push program. They hold the genetic material for an individual. In the initial population, we create random plushys.

+Propeller 0.3.0

Propeller 0.3.0

Released under the EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0

Yet another Push-based genetic programming system in Clojure.

Installation

To install, add the following dependency to your project or build file:

[net.clojars.lspector/propeller "0.3.0"]

Topics

Namespaces

propeller.genome

The genetic material in Propeller. A plushy is a list of Push instructions that represent a Push program. They hold the genetic material for an individual. In the initial population, we create random plushys.

Public variables and functions:

propeller.gp

Main genetic programming loop.

Public variables and functions:

propeller.problems.PSB2.bouncing-balls

BOUNCING BALLS from PSB2

@@ -26,13 +26,13 @@

propeller.problems.valiant

Possibly impossible to solve with genetic programming. Stems from the work of Leslie Valiant and involves determining the parity of an unknown subsequence of a larger sequence of bits.

propeller.push.instructions.bool

BOOLEAN Instructions, created with propeller.push.instructions/def-instruction

-

Public variables and functions:

    propeller.push.instructions.character

    CHAR Instructions, created with propeller.push.instructions/def-instruction

    -

    Public variables and functions:

      propeller.push.instructions.code

      CODE Instructions, created with propeller.push.instructions/def-instruction

      -

      Public variables and functions:

        propeller.push.instructions.input-output

        INPUT and OUTPUT Instructions

        -

        Public variables and functions:

        propeller.push.instructions.bool

        BOOLEAN Instructions, created with propeller.push.instructions/def-instruction. List of instructions can be found at Additional Instructions.

        +

        Public variables and functions:

          propeller.push.instructions.character

          CHAR Instructions, created with propeller.push.instructions/def-instruction. List of instructions can be found at Additional Instructions.

          +

          Public variables and functions:

            propeller.push.instructions.code

            CODE Instructions, created with propeller.push.instructions/def-instruction. List of instructions can be found at Additional Instructions.

            +

            Public variables and functions:

              propeller.push.instructions.input-output

              INPUT and OUTPUT Instructions. Additional instructions can be found at Additional Instructions.

              +

              Public variables and functions:

              propeller.push.instructions.numeric

              FLOAT and INTEGER Instructions (polymorphic). Additional instructions can be found at Additional Instructions.

              propeller.push.instructions.polymorphic

              Polymorphic Instructions (for all stacks, with the exception of non-data ones like input and output)

              -

              propeller.push.instructions.string

              STRING Instructions, created with propeller.push.instructions/def-instruction

              +

              propeller.push.instructions.string

              STRING Instructions, created with propeller.push.instructions/def-instruction. List of instructions can be found at Additional Instructions.

              Public variables and functions:

                propeller.push.instructions.vector

                VECTOR instructions for all vector element subtypes: BOOLEAN, FLOAT, INTEGER, and STRING.

                propeller.push.interpreter

                Interprets Push programs.

                Public variables and functions:

                propeller.push.limits

                Values used by the Push instructions to keep the stack sizes within reasonable limits and values used by the Push instructions to keep computed values within reasonable size limits.

                diff --git a/docs/propeller.genome.html b/docs/propeller.genome.html index 94d2ac9..c0b5bd7 100644 --- a/docs/propeller.genome.html +++ b/docs/propeller.genome.html @@ -1,6 +1,6 @@ -propeller.genome documentation

                propeller.genome

                The genetic material in Propeller. A plushy is a list of Push instructions that represent a Push program. They hold the genetic material for an individual. In the initial population, we create random plushys.

                +propeller.genome documentation

                propeller.genome

                The genetic material in Propeller. A plushy is a list of Push instructions that represent a Push program. They hold the genetic material for an individual. In the initial population, we create random plushys.

                make-random-plushy

                (make-random-plushy instructions max-initial-plushy-size)

                Creates and returns a new plushy made of random instructions and of a maximum size of max-initial-plushy-size.

                plushy->push

                (plushy->push plushy)(plushy->push plushy argmap)

                Returns the Push program expressed by the given plushy representation.

                The function takes in a plushy representation as input and converts it into a Push program by iteratively processing the plushy elements and adding instructions to the push program. It also handles the case where there are open instructions that need to be closed before the end of the program.

                diff --git a/docs/propeller.gp.html b/docs/propeller.gp.html index 224168b..827d81d 100644 --- a/docs/propeller.gp.html +++ b/docs/propeller.gp.html @@ -1,6 +1,6 @@ -propeller.gp documentation

                propeller.gp

                Main genetic programming loop.

                +propeller.gp documentation

                propeller.gp

                Main genetic programming loop.

                gp

                (gp {:keys [population-size max-generations error-function instructions max-initial-plushy-size solution-error-threshold mapper], :or {solution-error-threshold 0.0, mapper pmap}, :as argmap})

                Main GP loop.

                On each iteration, it creates a population of random plushies using a mapper function and genome/make-random-plushy function, then it sorts the population by the total error using the error-function and sort-by function. It then takes the best individual from the sorted population, and if the parent selection is set to epsilon-lexicase, it adds the epsilons to the argmap.

                The function then checks if the custom-report argument is set, if so it calls that function passing the evaluated population, current generation and argmap. If not, it calls the report function passing the evaluated population, current generation and argmap.

                diff --git a/docs/propeller.problems.PSB2.basement.html b/docs/propeller.problems.PSB2.basement.html index 554fa4e..542ef52 100644 --- a/docs/propeller.problems.PSB2.basement.html +++ b/docs/propeller.problems.PSB2.basement.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.basement documentation

                propeller.problems.PSB2.basement

                BASEMENT from PSB2

                +propeller.problems.PSB2.basement documentation

                propeller.problems.PSB2.basement

                BASEMENT from PSB2

                Given a vector of integers, return the first index such that the sum of all integers from the start of the vector to that index (inclusive) is negative.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.bouncing-balls.html b/docs/propeller.problems.PSB2.bouncing-balls.html index 3f22162..e7f2c78 100644 --- a/docs/propeller.problems.PSB2.bouncing-balls.html +++ b/docs/propeller.problems.PSB2.bouncing-balls.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.bouncing-balls documentation

                propeller.problems.PSB2.bouncing-balls

                BOUNCING BALLS from PSB2

                +propeller.problems.PSB2.bouncing-balls documentation

                propeller.problems.PSB2.bouncing-balls

                BOUNCING BALLS from PSB2

                Given a starting height and a height after the first bounce of a dropped ball, calculate the bounciness index (height of first bounce / starting height). Then, given a number of bounces, use the bounciness index to calculate the total distance that the ball travels across those bounces.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.bowling.html b/docs/propeller.problems.PSB2.bowling.html index 47cc4fa..67d22f6 100644 --- a/docs/propeller.problems.PSB2.bowling.html +++ b/docs/propeller.problems.PSB2.bowling.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.bowling documentation

                propeller.problems.PSB2.bowling

                BOWLING from PSB2

                +propeller.problems.PSB2.bowling documentation

                propeller.problems.PSB2.bowling

                BOWLING from PSB2

                Given a string representing the individual bowls in a 10-frame round of 10 pin bowling, return the score of that round.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.camel-case.html b/docs/propeller.problems.PSB2.camel-case.html index cb67a1e..241fc28 100644 --- a/docs/propeller.problems.PSB2.camel-case.html +++ b/docs/propeller.problems.PSB2.camel-case.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.camel-case documentation

                propeller.problems.PSB2.camel-case

                CAMEL CASE from PSB2

                +propeller.problems.PSB2.camel-case documentation

                propeller.problems.PSB2.camel-case

                CAMEL CASE from PSB2

                Take a string in kebab-case and convert all of the words to camelCase. Each group of words to convert is delimited by “-”, and each grouping is separated by a space. For example: “camel-case example-test-string” → “camelCase exampleTestString”

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.dice-game.html b/docs/propeller.problems.PSB2.dice-game.html index 1b08561..5faec88 100644 --- a/docs/propeller.problems.PSB2.dice-game.html +++ b/docs/propeller.problems.PSB2.dice-game.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.dice-game documentation

                propeller.problems.PSB2.dice-game

                DICE GAME from PSB2

                +propeller.problems.PSB2.dice-game documentation

                propeller.problems.PSB2.dice-game

                DICE GAME from PSB2

                Peter has an n sided die and Colin has an m sided die. If they both roll their dice at the same time, return the probability that Peter rolls strictly higher than Colin.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.fizz-buzz.html b/docs/propeller.problems.PSB2.fizz-buzz.html index 694c381..b9bf571 100644 --- a/docs/propeller.problems.PSB2.fizz-buzz.html +++ b/docs/propeller.problems.PSB2.fizz-buzz.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.fizz-buzz documentation

                propeller.problems.PSB2.fizz-buzz

                FIZZ BUZZ from PSB2 Given an integer x, return “Fizz” if x is divisible by 3, “Buzz” if x is divisible by 5, “FizzBuzz” if x is divisible by 3 and 5, and a string version of x if none of the above hold.

                +propeller.problems.PSB2.fizz-buzz documentation

                propeller.problems.PSB2.fizz-buzz

                FIZZ BUZZ from PSB2 Given an integer x, return “Fizz” if x is divisible by 3, “Buzz” if x is divisible by 5, “FizzBuzz” if x is divisible by 3 and 5, and a string version of x if none of the above hold.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                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 STRING stack.

                diff --git a/docs/propeller.problems.PSB2.fuel-cost.html b/docs/propeller.problems.PSB2.fuel-cost.html index 576b2a3..259bb28 100644 --- a/docs/propeller.problems.PSB2.fuel-cost.html +++ b/docs/propeller.problems.PSB2.fuel-cost.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.fuel-cost documentation

                propeller.problems.PSB2.fuel-cost

                FUEL COST from PSB2

                +propeller.problems.PSB2.fuel-cost documentation

                propeller.problems.PSB2.fuel-cost

                FUEL COST from PSB2

                Given a vector of positive integers, divide each by 3, round the result down to the nearest integer, and subtract 2. Return the sum of all of the new integers in the vector

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.gcd.html b/docs/propeller.problems.PSB2.gcd.html index 13360a6..57dc5e4 100644 --- a/docs/propeller.problems.PSB2.gcd.html +++ b/docs/propeller.problems.PSB2.gcd.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.gcd documentation

                propeller.problems.PSB2.gcd

                GCD GREATEST COMMON DIVISOR from PSB2

                +propeller.problems.PSB2.gcd documentation

                propeller.problems.PSB2.gcd

                GCD GREATEST COMMON DIVISOR from PSB2

                Given two integers, return the largest integer that divides each of the integers evenly

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.luhn.html b/docs/propeller.problems.PSB2.luhn.html index b845e99..7e0ea2e 100644 --- a/docs/propeller.problems.PSB2.luhn.html +++ b/docs/propeller.problems.PSB2.luhn.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.luhn documentation

                propeller.problems.PSB2.luhn

                LUHN from PSB2

                +propeller.problems.PSB2.luhn documentation

                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 propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.middle-character.html b/docs/propeller.problems.PSB2.middle-character.html index 207847e..9450485 100644 --- a/docs/propeller.problems.PSB2.middle-character.html +++ b/docs/propeller.problems.PSB2.middle-character.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.middle-character documentation

                propeller.problems.PSB2.middle-character

                MIDDLE CHARACTER from PSB2

                +propeller.problems.PSB2.middle-character documentation

                propeller.problems.PSB2.middle-character

                MIDDLE CHARACTER from PSB2

                Given a string, return the middle character as a string if it is odd length; return the two middle characters as a string if it is even length.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.paired-digits.html b/docs/propeller.problems.PSB2.paired-digits.html index fa166da..8cadb85 100644 --- a/docs/propeller.problems.PSB2.paired-digits.html +++ b/docs/propeller.problems.PSB2.paired-digits.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.paired-digits documentation

                propeller.problems.PSB2.paired-digits

                PAIRED DIGITS from PSB2

                +propeller.problems.PSB2.paired-digits documentation

                propeller.problems.PSB2.paired-digits

                PAIRED DIGITS from PSB2

                Given a string of digits, return the sum of the digits whose following digit is the same.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.shopping-list.html b/docs/propeller.problems.PSB2.shopping-list.html index 92b8937..423f8cf 100644 --- a/docs/propeller.problems.PSB2.shopping-list.html +++ b/docs/propeller.problems.PSB2.shopping-list.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.shopping-list documentation

                propeller.problems.PSB2.shopping-list

                DICE GAME from PSB2

                +propeller.problems.PSB2.shopping-list documentation

                propeller.problems.PSB2.shopping-list

                DICE GAME from PSB2

                Peter has an n sided die and Colin has an m sided die. If they both roll their dice at the same time, return the probability that Peter rolls strictly higher than Colin.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.snow-day.html b/docs/propeller.problems.PSB2.snow-day.html index bb56a72..bd89aca 100644 --- a/docs/propeller.problems.PSB2.snow-day.html +++ b/docs/propeller.problems.PSB2.snow-day.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.snow-day documentation

                propeller.problems.PSB2.snow-day

                SNOW DAY from PSB2

                +propeller.problems.PSB2.snow-day documentation

                propeller.problems.PSB2.snow-day

                SNOW DAY from PSB2

                Given an integer representing a number of hours and 3 floats representing how much snow is on the ground, the rate of snow fall, and the proportion of snow melting per hour, return the amount of snow on the ground after the amount of hours given. Each hour is considered a discrete event of adding snow and then melting, not a continuous process.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.solve-boolean.html b/docs/propeller.problems.PSB2.solve-boolean.html index 208eb0c..d857fdc 100644 --- a/docs/propeller.problems.PSB2.solve-boolean.html +++ b/docs/propeller.problems.PSB2.solve-boolean.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.solve-boolean documentation

                propeller.problems.PSB2.solve-boolean

                SOLVE BOOLEAN from PSB2

                +propeller.problems.PSB2.solve-boolean documentation

                propeller.problems.PSB2.solve-boolean

                SOLVE BOOLEAN from PSB2

                Given a string representing a Boolean expression consisting of T, F, |, and &, evaluate it and return the resulting Boolean.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.spin-words.html b/docs/propeller.problems.PSB2.spin-words.html index d0b93be..1958e92 100644 --- a/docs/propeller.problems.PSB2.spin-words.html +++ b/docs/propeller.problems.PSB2.spin-words.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.spin-words documentation

                propeller.problems.PSB2.spin-words

                SPIN WORDS from PSB2

                +propeller.problems.PSB2.spin-words documentation

                propeller.problems.PSB2.spin-words

                SPIN WORDS from PSB2

                Given a string of one or more words (separated by spaces), reverse all of the words that are five or more letters long and return the resulting string.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.square-digits.html b/docs/propeller.problems.PSB2.square-digits.html index 2fcd276..0a3dc65 100644 --- a/docs/propeller.problems.PSB2.square-digits.html +++ b/docs/propeller.problems.PSB2.square-digits.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.square-digits documentation

                propeller.problems.PSB2.square-digits

                SQUARE DIGITS from PSB2

                +propeller.problems.PSB2.square-digits documentation

                propeller.problems.PSB2.square-digits

                SQUARE DIGITS from PSB2

                Given a positive integer, square each digit and concatenate the squares into a returned string.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.substitution-cipher.html b/docs/propeller.problems.PSB2.substitution-cipher.html index 13af2d7..b2a0e80 100644 --- a/docs/propeller.problems.PSB2.substitution-cipher.html +++ b/docs/propeller.problems.PSB2.substitution-cipher.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.substitution-cipher documentation

                propeller.problems.PSB2.substitution-cipher

                SUBSTITUTION CIPHER from PSB2

                +propeller.problems.PSB2.substitution-cipher documentation

                propeller.problems.PSB2.substitution-cipher

                SUBSTITUTION CIPHER from PSB2

                This problem gives 3 strings. The first two represent a cipher, mapping each character in one string to the one at the same index in the other string. The program must apply this cipher to the third string and return the deciphered message.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                diff --git a/docs/propeller.problems.PSB2.twitter.html b/docs/propeller.problems.PSB2.twitter.html index 24f048a..17481cf 100644 --- a/docs/propeller.problems.PSB2.twitter.html +++ b/docs/propeller.problems.PSB2.twitter.html @@ -1,6 +1,6 @@ -propeller.problems.PSB2.twitter documentation

                propeller.problems.PSB2.twitter

                TWITTER from PSB2 Given a string representing a tweet, validate whether the tweet meets Twitter’s original character requirements. If the tweet has more than 140 characters, return the string “Too many characters”. If the tweet is empty, return the string “You didn’t type anything”. Otherwise, return “Your tweet has X characters”, where the X is the number of characters in the tweet.

                +propeller.problems.PSB2.twitter documentation

                propeller.problems.PSB2.twitter

                TWITTER from PSB2 Given a string representing a tweet, validate whether the tweet meets Twitter’s original character requirements. If the tweet has more than 140 characters, return the string “Too many characters”. If the tweet is empty, return the string “You didn’t type anything”. Otherwise, return “Your tweet has X characters”, where the X is the number of characters in the tweet.

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

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                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 STRING stack.

                diff --git a/docs/propeller.problems.simple-regression.html b/docs/propeller.problems.simple-regression.html index ac75375..c102296 100644 --- a/docs/propeller.problems.simple-regression.html +++ b/docs/propeller.problems.simple-regression.html @@ -1,6 +1,6 @@ -propeller.problems.simple-regression documentation

                propeller.problems.simple-regression

                Simple Regression:

                +propeller.problems.simple-regression documentation

                propeller.problems.simple-regression

                Simple Regression:

                Given inputs and outputs, find the target function.

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                error-function

                (error-function argmap data individual)

                Finds the behaviors and errors of an individual. The error is the absolute deviation between the target output value and the program’s selected behavior, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.

                diff --git a/docs/propeller.problems.software.number-io.html b/docs/propeller.problems.software.number-io.html index cd7bd74..1c4c1b4 100644 --- a/docs/propeller.problems.software.number-io.html +++ b/docs/propeller.problems.software.number-io.html @@ -1,6 +1,6 @@ -propeller.problems.software.number-io documentation

                propeller.problems.software.number-io

                Number IO from iJava (http://ijava.cs.umass.edu/)

                +propeller.problems.software.number-io documentation

                propeller.problems.software.number-io

                Number IO from iJava (http://ijava.cs.umass.edu/)

                 This problem file defines the following problem:
                 

                There are two inputs, a float and an int. The program must read them in, find their sum as a float, and print the result as a float.

                diff --git a/docs/propeller.problems.software.smallest.html b/docs/propeller.problems.software.smallest.html index 850e16e..010145b 100644 --- a/docs/propeller.problems.software.smallest.html +++ b/docs/propeller.problems.software.smallest.html @@ -1,6 +1,6 @@ -propeller.problems.software.smallest documentation

                propeller.problems.software.smallest

                SMALLEST PROBLEM from C. Le Goues et al., "The ManyBugs and IntroClass Benchmarks

                +propeller.problems.software.smallest documentation

                propeller.problems.software.smallest

                SMALLEST PROBLEM from C. Le Goues et al., "The ManyBugs and IntroClass Benchmarks

                for Automated Repair of C Programs," in IEEE Transactions on Software

                Engineering, vol. 41, no. 12, pp. 1236-1256, Dec. 1 2015.
                 
                diff --git a/docs/propeller.problems.string-classification.html b/docs/propeller.problems.string-classification.html
                index 4d87e45..25c33fe 100644
                --- a/docs/propeller.problems.string-classification.html
                +++ b/docs/propeller.problems.string-classification.html
                @@ -1,6 +1,6 @@
                 
                -propeller.problems.string-classification documentation

                propeller.problems.string-classification

                String Classification:

                +propeller.problems.string-classification documentation

                propeller.problems.string-classification

                String Classification:

                Given a string, return true if it contains A, C, G, and T. Else return false.

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                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 BOOLEAN stack.

                diff --git a/docs/propeller.problems.valiant.html b/docs/propeller.problems.valiant.html index 578a250..c6a7af9 100644 --- a/docs/propeller.problems.valiant.html +++ b/docs/propeller.problems.valiant.html @@ -1,6 +1,6 @@ -propeller.problems.valiant documentation

                propeller.problems.valiant

                Possibly impossible to solve with genetic programming. Stems from the work of Leslie Valiant and involves determining the parity of an unknown subsequence of a larger sequence of bits.

                +propeller.problems.valiant documentation

                propeller.problems.valiant

                Possibly impossible to solve with genetic programming. Stems from the work of Leslie Valiant and involves determining the parity of an unknown subsequence of a larger sequence of bits.

                -main

                (-main & args)

                Runs propel-gp, giving it a map of arguments.

                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. The behavior is here defined as the final top item on the BOOLEAN stack.

                instructions

                A list of instructions which includes keyword strings with the format “in + i” where i is a number from 0 to num-vars-1 concatenated with boolean and exec_if instructions and close.

                diff --git a/docs/propeller.push.instructions.bool.html b/docs/propeller.push.instructions.bool.html index 0eeb003..cfad457 100644 --- a/docs/propeller.push.instructions.bool.html +++ b/docs/propeller.push.instructions.bool.html @@ -1,4 +1,4 @@ -propeller.push.instructions.bool documentation

                propeller.push.instructions.bool

                BOOLEAN Instructions, created with propeller.push.instructions/def-instruction

                +propeller.push.instructions.bool documentation

                propeller.push.instructions.bool

                BOOLEAN Instructions, created with propeller.push.instructions/def-instruction. List of instructions can be found at Additional Instructions.

                \ No newline at end of file diff --git a/docs/propeller.push.instructions.character.html b/docs/propeller.push.instructions.character.html index 4a42733..63935b1 100644 --- a/docs/propeller.push.instructions.character.html +++ b/docs/propeller.push.instructions.character.html @@ -1,4 +1,4 @@ -propeller.push.instructions.character documentation

                propeller.push.instructions.character

                CHAR Instructions, created with propeller.push.instructions/def-instruction

                +propeller.push.instructions.character documentation

                propeller.push.instructions.character

                CHAR Instructions, created with propeller.push.instructions/def-instruction. List of instructions can be found at Additional Instructions.

                \ No newline at end of file diff --git a/docs/propeller.push.instructions.code.html b/docs/propeller.push.instructions.code.html index f0e69fb..ee510fd 100644 --- a/docs/propeller.push.instructions.code.html +++ b/docs/propeller.push.instructions.code.html @@ -1,4 +1,4 @@ -propeller.push.instructions.code documentation

                propeller.push.instructions.code

                CODE Instructions, created with propeller.push.instructions/def-instruction

                +propeller.push.instructions.code documentation

                propeller.push.instructions.code

                CODE Instructions, created with propeller.push.instructions/def-instruction. List of instructions can be found at Additional Instructions.

                \ No newline at end of file diff --git a/docs/propeller.push.instructions.html b/docs/propeller.push.instructions.html index 8704feb..0124fb5 100644 --- a/docs/propeller.push.instructions.html +++ b/docs/propeller.push.instructions.html @@ -1,6 +1,6 @@ -propeller.push.instructions documentation

                propeller.push.instructions

                Push Instructions

                +propeller.push.instructions documentation

                propeller.push.instructions

                Push Instructions

                def-instruction

                (def-instruction instruction function)

                Defines a Push instruction as a keyword-function pair, and adds it to the instruction table

                generate-instructions

                (generate-instructions stacks functions)

                Given a sequence of stacks, e.g. :float :integer, and a sequence of suffix function strings, e.g. _add, _mult, _eq, automates the generation of all possible combination instructions, which here would be :float_add, :float_mult, :float_eq, :integer_add, :integer_mult, and :integer_eq, also transferring and updating the generic function’s stack-type metadata. For some vector instructions, the placeholder :elem will be replaced with the stack of the corresponding element type (e.g. for :vector_integer, with :integer)

                get-literal-type

                (get-literal-type data)

                If a piece of data is a literal, return its corresponding stack name e.g. :integer. Otherwise, return nil.

                diff --git a/docs/propeller.push.instructions.input-output.html b/docs/propeller.push.instructions.input-output.html index cc908bc..70af792 100644 --- a/docs/propeller.push.instructions.input-output.html +++ b/docs/propeller.push.instructions.input-output.html @@ -1,6 +1,6 @@ -propeller.push.instructions.input-output documentation

                propeller.push.instructions.input-output

                INPUT and OUTPUT Instructions

                +propeller.push.instructions.input-output documentation

                propeller.push.instructions.input-output

                INPUT and OUTPUT Instructions. Additional instructions can be found at Additional Instructions.

                _print

                Instruction to print output.

                handle-input-instruction

                (handle-input-instruction state instruction)

                Allows Push to handle input instructions of the form :inN, e.g. :in2, taking elements thus labeled from the :input map and pushing them onto the :exec stack.

                \ No newline at end of file diff --git a/docs/propeller.push.instructions.numeric.html b/docs/propeller.push.instructions.numeric.html index db6b871..efaede2 100644 --- a/docs/propeller.push.instructions.numeric.html +++ b/docs/propeller.push.instructions.numeric.html @@ -1,6 +1,6 @@ -propeller.push.instructions.numeric documentation

                propeller.push.instructions.numeric

                FLOAT and INTEGER Instructions (polymorphic)

                +propeller.push.instructions.numeric documentation

                propeller.push.instructions.numeric

                FLOAT and INTEGER Instructions (polymorphic). Additional instructions can be found at Additional Instructions.

                _add

                Pushes the sum of the top two items onto the same stack

                _dec

                FIXME: write docs

                _from_boolean

                Pushes 1 / 1.0 if the top BOOLEAN is TRUE, or 0 / 0.0 if FALSE

                diff --git a/docs/propeller.push.instructions.polymorphic.html b/docs/propeller.push.instructions.polymorphic.html index bc69ce1..414a3cf 100644 --- a/docs/propeller.push.instructions.polymorphic.html +++ b/docs/propeller.push.instructions.polymorphic.html @@ -1,6 +1,6 @@ -propeller.push.instructions.polymorphic documentation

                propeller.push.instructions.polymorphic

                Polymorphic Instructions (for all stacks, with the exception of non-data ones like input and output)

                +propeller.push.instructions.polymorphic documentation

                propeller.push.instructions.polymorphic

                Polymorphic Instructions (for all stacks, with the exception of non-data ones like input and output)

                _deep_dup

                Pushes a copy of an indexed item from deep in the stack, without removing it. The top INTEGER is used to determine the index from the BOTTOM of the stack.

                _dup

                Duplicates the top item of the stack. Does not pop its argument (since that would negate the effect of the duplication)

                _dup_items

                Duplicates the top n items on the stack, one time each. The number n is determined by the top INTEGER. If n <= 0, no items will be duplicated. If fewer than n items are on the stack, the entire stack will be duplicated. The final number of items on the stack is limited to globals/max-stack-items.

                diff --git a/docs/propeller.push.instructions.string.html b/docs/propeller.push.instructions.string.html index b15ce08..58976b1 100644 --- a/docs/propeller.push.instructions.string.html +++ b/docs/propeller.push.instructions.string.html @@ -1,4 +1,4 @@ -propeller.push.instructions.string documentation

                propeller.push.instructions.string

                STRING Instructions, created with propeller.push.instructions/def-instruction

                +propeller.push.instructions.string documentation

                propeller.push.instructions.string

                STRING Instructions, created with propeller.push.instructions/def-instruction. List of instructions can be found at Additional Instructions.

                \ No newline at end of file diff --git a/docs/propeller.push.instructions.vector.html b/docs/propeller.push.instructions.vector.html index 8a13c02..35935dc 100644 --- a/docs/propeller.push.instructions.vector.html +++ b/docs/propeller.push.instructions.vector.html @@ -1,6 +1,6 @@ -propeller.push.instructions.vector documentation

                propeller.push.instructions.vector

                VECTOR instructions for all vector element subtypes: BOOLEAN, FLOAT, INTEGER, and STRING.

                +propeller.push.instructions.vector documentation

                propeller.push.instructions.vector

                VECTOR instructions for all vector element subtypes: BOOLEAN, FLOAT, INTEGER, and STRING.

                _butlast

                Pushes the butlast of the top item

                _concat

                Concats and pushes the top two vectors of the stack

                _conj

                Conj’s the top item of the appropriately-typed literal stack onto the vector stack (e.g. pop the top INTEGER and conj it onto the top VECTOR_INTEGER)

                diff --git a/docs/propeller.push.interpreter.html b/docs/propeller.push.interpreter.html index 1c1b924..e7edc5f 100644 --- a/docs/propeller.push.interpreter.html +++ b/docs/propeller.push.interpreter.html @@ -1,6 +1,6 @@ -propeller.push.interpreter documentation

                propeller.push.interpreter

                Interprets Push programs.

                +propeller.push.interpreter documentation

                propeller.push.interpreter

                Interprets Push programs.

                interpret-one-step

                (interpret-one-step state)

                Takes a Push state and executes the next instruction on the exec stack.

                interpret-program

                (interpret-program program start-state step-limit)

                Runs the given problem starting with the stacks in start-state. If the start-state includes the key :keep-history with a truthy value, then the returned state will include the key :history with a value that is a vector containing all states prior to the final state.

                \ No newline at end of file diff --git a/docs/propeller.push.limits.html b/docs/propeller.push.limits.html index 09c134f..efc7786 100644 --- a/docs/propeller.push.limits.html +++ b/docs/propeller.push.limits.html @@ -1,6 +1,6 @@ -propeller.push.limits documentation

                propeller.push.limits

                Values used by the Push instructions to keep the stack sizes within reasonable limits and values used by the Push instructions to keep computed values within reasonable size limits.

                +propeller.push.limits documentation

                propeller.push.limits

                Values used by the Push instructions to keep the stack sizes within reasonable limits and values used by the Push instructions to keep computed values within reasonable size limits.

                limit-code

                (limit-code code)

                Limits code to max-code-points and max-code-depth.

                limit-number

                (limit-number n)

                Returns a version of the number n that is within reasonable size bounds.

                limit-string

                (limit-string s)

                Limits string length to max-string-length.

                diff --git a/docs/propeller.push.state.html b/docs/propeller.push.state.html index 357f641..ac34bbc 100644 --- a/docs/propeller.push.state.html +++ b/docs/propeller.push.state.html @@ -1,6 +1,6 @@ -propeller.push.state documentation

                propeller.push.state

                Push states

                +propeller.push.state documentation

                propeller.push.state

                Push states

                empty-stack?

                (empty-stack? state stack)

                Returns true if the stack is empty

                example-state

                FIXME: write docs

                get-args-from-stacks

                (get-args-from-stacks state stacks)

                Takes a state and a collection of stacks to take args from. If there are enough args on each of the desired stacks, returns a map with keys {:state :args}, where :state is the new state and :args is a list of args popped from the stacks. If there aren’t enough args on the stacks, returns :not-enough-args without popping anything

                diff --git a/docs/propeller.selection.html b/docs/propeller.selection.html index 124632a..27d2ddb 100644 --- a/docs/propeller.selection.html +++ b/docs/propeller.selection.html @@ -1,6 +1,6 @@ -propeller.selection documentation

                propeller.selection

                Propeller includes many kinds of genetic operators to select parents within the population such as tournament selection, lexicase selection, and epsilon lexicase selection.

                +propeller.selection documentation

                propeller.selection

                Propeller includes many kinds of genetic operators to select parents within the population such as tournament selection, lexicase selection, and epsilon lexicase selection.

                epsilon-lexicase-selection

                (epsilon-lexicase-selection pop argmap)

                Selects an individual from the population using epsilon-lexicase selection. Epsilon lexicase selection follows the same process as lexicase selection except, for a test case, only individuals with an error outside of a predefined epsilon are filtered.

                epsilon-list

                (epsilon-list pop)

                List of epsilons for each training case based on median absolute deviation of errors.

                lexicase-selection

                (lexicase-selection pop argmap)

                Selects an individual from the population using lexicase selection. Lexicase parent selection filters the population by considering one random training case at a time, eliminating any individuals with errors for the current case that are worse than the best error in the selection pool, until a single individual remains.

                diff --git a/docs/propeller.simplification.html b/docs/propeller.simplification.html index dfd9f44..cdcca9e 100644 --- a/docs/propeller.simplification.html +++ b/docs/propeller.simplification.html @@ -1,6 +1,6 @@ -propeller.simplification documentation

                propeller.simplification

                To use Propeller’s auto-simplification system, simply include the following four command line arguments when running a problem:

                +propeller.simplification documentation

                propeller.simplification

                To use Propeller’s auto-simplification system, simply include the following four command line arguments when running a problem:

                :simplification? true
                 

                Toggle auto-simplification

                diff --git a/docs/propeller.tools.calculus.html b/docs/propeller.tools.calculus.html index 3ece09b..c108bad 100644 --- a/docs/propeller.tools.calculus.html +++ b/docs/propeller.tools.calculus.html @@ -1,6 +1,6 @@ -propeller.tools.calculus documentation

                propeller.tools.calculus

                Functions for calculus operations

                +propeller.tools.calculus documentation

                propeller.tools.calculus

                Functions for calculus operations

                deriv

                (deriv f c)(deriv f)

                Returns the derivative of f evaluated at c. If called with only one argument, it returns the derivative function.

                integrate

                (integrate f)(integrate f a b)

                Returns the definite integral of f over a, b using Simpson’s method. If called with only one argument (the function), returns the indefinite integral, which takes as input a value x and (optionally) a constant c.

                \ No newline at end of file diff --git a/docs/propeller.tools.character.html b/docs/propeller.tools.character.html index 8735f5f..5a35d50 100644 --- a/docs/propeller.tools.character.html +++ b/docs/propeller.tools.character.html @@ -1,6 +1,6 @@ -propeller.tools.character documentation

                propeller.tools.character

                Functions for CHARs

                +propeller.tools.character documentation

                propeller.tools.character

                Functions for CHARs

                get-ascii

                (get-ascii c)

                Gets the ASCII code of a char

                is-digit

                (is-digit c)

                Returns true if the given character is a digit, 0-9.

                is-letter

                (is-letter c)

                Returns true if the given character is a letter, A-Z or a-z.

                diff --git a/docs/propeller.tools.distributions.html b/docs/propeller.tools.distributions.html index fc7acc4..651e8e5 100644 --- a/docs/propeller.tools.distributions.html +++ b/docs/propeller.tools.distributions.html @@ -1,6 +1,6 @@ -propeller.tools.distributions documentation

                propeller.tools.distributions

                Functions to calculate distribution.

                +propeller.tools.distributions documentation

                propeller.tools.distributions

                Functions to calculate distribution.

                cdf-norm

                (cdf-norm {:keys [x mu sigma], :or {mu 0, sigma 1}})

                Parameters: {:keys x mu sigma} Returns the value of the Normal Cumulative Distribution Function at a particular value x. If no distributional parameters are provided, defaults to the Standard Normal CDF. Accepts an argument map with keys :x, and optionally :mu and :sigma.

                pdf-norm

                (pdf-norm {:keys [x mu sigma], :or {mu 0, sigma 1}})

                Returns the value of the Normal Probability Distribution Function at a particular value x. If no distributional parameters are provided, defaults to the Standard Normal PDF. Accepts an argument map with keys :x, and optionally :mu and :sigma.

                quant-norm

                (quant-norm {:keys [p mu sigma], :or {mu 0, sigma 1}})

                For a given probability p, returns the corresponding value of the quantile function (i.e. the inverse Cumulative Distribution Function). If no distributional parameters are provided, defaults to Standard Normal quantiles. Accepts an argument map with keys :p, and optionally :mu and :sigma.

                diff --git a/docs/propeller.tools.math.html b/docs/propeller.tools.math.html index 2d97a9f..40d2c05 100644 --- a/docs/propeller.tools.math.html +++ b/docs/propeller.tools.math.html @@ -1,6 +1,6 @@ -propeller.tools.math documentation

                propeller.tools.math

                Math functions.

                +propeller.tools.math documentation

                propeller.tools.math

                Math functions.

                abs

                (abs x)

                Returns the absolute value of a number.

                approx=

                (approx= x y epsilon)

                Returns true if the absolute difference between x and y is less than or equal to some specified error level, epsilon.

                ceil

                (ceil x)

                Returns the smallest integer greater than or equal to x.

                diff --git a/docs/propeller.tools.metrics.html b/docs/propeller.tools.metrics.html index dfdc492..e7adc9a 100644 --- a/docs/propeller.tools.metrics.html +++ b/docs/propeller.tools.metrics.html @@ -1,6 +1,6 @@ -propeller.tools.metrics documentation

                propeller.tools.metrics

                Functions to measure things.

                +propeller.tools.metrics documentation

                propeller.tools.metrics

                Functions to measure things.

                compute-next-row

                (compute-next-row prev-row current-element other-seq pred)

                computes the next row using the prev-row current-element and the other seq

                hamming-distance

                (hamming-distance seq1 seq2)

                Calculates the Hamming distance between two sequences, including strings.

                levenshtein-distance

                (levenshtein-distance a b & {p :predicate, :or {p =}})

                Levenshtein Distance - http://en.wikipedia.org/wiki/Levenshtein_distance In Information Theory and Computer Science, the Levenshtein distance is a metric for measuring the amount of difference between two sequences. This is a functional implementation of the Levenshtein edit distance with as little mutability as possible. Still maintains the O(nm) guarantee.

                diff --git a/docs/propeller.utils.html b/docs/propeller.utils.html index 7c9d392..374054c 100644 --- a/docs/propeller.utils.html +++ b/docs/propeller.utils.html @@ -1,6 +1,6 @@ -propeller.utils documentation

                propeller.utils

                Useful functions.

                +propeller.utils documentation

                propeller.utils

                Useful functions.

                count-points

                (count-points tree)

                Returns the number of points in tree, where each atom and each pair of parentheses counts as a point.

                depth

                (depth tree)

                Returns the height of the nested list called tree. Borrowed idea from here: https://stackoverflow.com/a/36865180/2023312 Works by looking at the path from each node in the tree to the root, and finding the longest one. Note: does not treat an empty list as having any height.

                ensure-list

                (ensure-list thing)

                Returns a non-lazy list if passed a seq argument. Otherwise, returns a list containing the argument.

                diff --git a/docs/propeller.variation.html b/docs/propeller.variation.html index 35b412a..6d0628c 100644 --- a/docs/propeller.variation.html +++ b/docs/propeller.variation.html @@ -1,6 +1,6 @@ -propeller.variation documentation

                propeller.variation

                Propeller includes many kinds of genetic operators to create variation within the population. You can specify the rate of the variation genetic operators with the :variation map.

                +propeller.variation documentation

                propeller.variation

                Propeller includes many kinds of genetic operators to create variation within the population. You can specify the rate of the variation genetic operators with the :variation map.

                Variation

                Propeller includes many kinds of genetic operators to create variation within the population. You can specify the rate of the variation genetic operators with the :variation map.

                Crossover

                diff --git a/scripts/FunctionsToMD.py b/scripts/FunctionsToMD.py new file mode 100644 index 0000000..3750167 --- /dev/null +++ b/scripts/FunctionsToMD.py @@ -0,0 +1,70 @@ + +# Takes Push instructions defined through (def-instruction and +# puts their documentation into a markdown file in docs_src + +import os +from mdutils.mdutils import MdUtils +mdFile = MdUtils(file_name='src/docs_src/Additional_Instructions', title='Bool, Char, Code, Input-Output, Numeric, and String Instructions') + +os.chdir('..') + +instructionFiles = os.listdir('src/propeller/push/instructions') +print(instructionFiles) + +hasDefInstruction = False +for file in instructionFiles: + mdFile.new_header(level=1, title=file) + try: + print(file) + + # opening and reading the file + file_read = open('src/propeller/push/instructions/'+file, "r") + + # set search text + text = "(def-instruction" + + # reading file content line by line. + lines = file_read.readlines() + + # looping through each line in the file + # if the line contains "\(def-instruction", go through lines above that line and add + # the Clojure comments to a list which is later written into markdown file. + for count, line in enumerate(lines): + new_list = [] + # print(line) + # print(count) + if text in line: + hasDefInstruction = True + # print(line) + mdFile.new_header(level=2, title=lines[count+1].strip()) + isComment = True + inc = 1 + while isComment: + if lines[count-inc].startswith(';;'): + new_list.append(lines[count-inc].replace(';', '').strip()) + # print(lines[count-inc]) + inc = inc + 1 + else: + isComment = False + new_list.reverse() + for comment in new_list: + mdFile.write(comment+' ') + functionInfo = lines[count+1].strip() + lines[count-1].replace(';', '').strip() + # print(functionInfo) + new_list.append(functionInfo) + # closing file after reading + file_read.close() + + # the input string doesn't + # found in the text file + if not hasDefInstruction: + print("\n\"" + text + "\" is not found in \"" + file + "\"!") + else: + print("There is"+text) + + # entering except block + # if input file doesn't exist + except: + print("\nThe file doesn't exist!") + +mdFile.create_md_file() diff --git a/src/docs_src/Additional_Instructions.md b/src/docs_src/Additional_Instructions.md new file mode 100644 index 0000000..e988343 --- /dev/null +++ b/src/docs_src/Additional_Instructions.md @@ -0,0 +1,140 @@ + +Bool, Char, Code, Input-Output, Numeric, and String Instructions +================================================================ + +# input_output.cljc + +## :print_newline +Prints new line + +# numeric.cljc + +## :float_cos +Pushes the cosine of the top FLOAT +## :float_sin +Pushes the sine of the top FLOAT +## :float_tan +Pushes the tangent of the top FLOAT +## :float_from_integer +Pushes the floating point version of the top INTEGER +## :integer_from_float +Pushes the result of truncating the top FLOAT towards negative infinity +# string.cljc + +## :string_butlast +Pushes the butlast of the top STRING (i.e. the string without its last letter) +## :string_concat +Pushes the concatenation of the top two STRINGs (second + first) +## :string_conj_char +Pushes the concatenation of the top STRING and the top CHAR (STRING + CHAR) +## :string_contains +Pushes TRUE if the top STRING is a substring of the second STRING, and FALSE otherwise +## :string_contains_char +Pushes TRUE if the top CHAR is contained in the top STRING, and FALSE otherwise +## :string_drop +Pushes the top STRING with n characters dropped, where n is taken from the top of the INTEGER stack +## :string_empty_string +Pushes TRUE if the top STRING is the empty string +## :string_first +Pushes the first CHAR of the top STRING +## :string_from_boolean +Pushes the STRING version of the top BOOLEAN, e.g. "true" +## :string_from_char +Pushes the STRING version of the top CHAR, e.g. "a" +## :string_from_float +Pushes the STRING version of the top FLOAT e.g. "2.05" +## :string_from_integer +Pushes the STRING version of the top INTEGER, e.g. "3" +## :string_indexof_char +Pushes the index of the top CHAR in the top STRING onto the INTEGER stack. If the top CHAR is not present in the top string, acts as a NOOP +## :string_iterate +Iterates over the top STRING using code on the EXEC stack +## :string_last +Pushes the last CHAR of the top STRING. If the string is empty, do nothing +## :string_length +Pushes the length of the top STRING onto the INTEGER stack +## :string_nth +Pushes the nth CHAR of the top STRING, where n is taken from the top of the INTEGER stack. If n exceeds the length of the string, it is reduced modulo the length of the string +## :string_occurencesof_char +Pushes the number of times the top CHAR occurs in the top STRING onto the INTEGER stack +## :string_parse_to_chars +Splits the top string into substrings of length 1 (i.e. into its component characters) and pushes them back onto the STRING stack in the same order +## :string_remove_char +Pushes the top STRING, with all occurrences of the top CHAR removed +## :string_replace +Pushes the third topmost STRING on stack, with all occurences of the second topmost STRING replaced by the top STRING +## :string_replace_char +Pushes the top STRING, with all occurences of the second topmost CHAR replaced with the top CHAR +## :string_replace_first +Pushes the third topmost STRING on stack, with the first occurence of the second topmost STRING replaced by the top STRING +## :string_replace_first_char +Pushes the top STRING, with the first occurence of the second topmost CHAR replaced with the top CHAR +## :string_rest +Pushes the rest of the top STRING (i.e. the string without its first letter) +## :string_reverse +Pushes the reverse of the top STRING +## :string_set_char +Pushes the top STRING, with the letter at index n (where n is taken from the INTEGER stack) replaced with the top CHAR. If n is out of bounds, it is reduced modulo the length of the string +## :string_split +Splits the top STRING on whitespace, and pushes back the resulting components in the same order +## :string_substr +Pushes the substring of the top STRING, with beginning and end indices determined by the second topmost and topmost INTEGERs respectively. If an index is out of bounds, the beginning/end of the string is used instead +## :string_take +Pushes the substring of the top STRING consisting of its first n letters, where n is determined by the top INTEGER + +# character.cljc + +## :char_is_letter +Pushes TRUE onto the BOOLEAN stack if the popped character is a letter +## :char_is_digit +Pushes TRUE onto the BOOLEAN stack if the popped character is a digit +## :char_is_whitespace +Pushes TRUE onto the BOOLEAN stack if the popped character is whitespace (newline, space, or tab) +## :char_from_float +Pops the FLOAT stack, converts the top item to a whole number, and pushes its corresponding ASCII value onto the CHAR stack. Whole numbers larger than 128 will be reduced modulo 128. For instance, 248.45 will result in x being pushed. +## :char_from_integer +Pops the INTEGER stack and pushes the top element's corresponding ASCII value onto the CHAR stack. Integers larger than 128 will be reduced modulo 128. For instance, 248 will result in x being pushed +## :char_all_from_string +Pops the STRING stack and pushes the top element's constituent characters onto the CHAR stack, in order. For instance, "hello" will result in the top of the CHAR stack being \h \e \l \l \o +# bool.cljc + +## :boolean_and +Pushes the logical AND of the top two BOOLEANs +## :boolean_or +Pushes the logical OR of the top two BOOLEANs +## :boolean_not +Pushes the logical NOT of the top BOOLEAN +## :boolean_xor +Pushes the logical XOR of the top two BOOLEAN +## :boolean_invert_first_then_and +Pushes the logical AND of the top two BOOLEANs, after applying NOT to the first one +## :boolean_invert_second_then_and +Pushes the logical AND of the top two BOOLEANs, after applying NOT to the second one +## :boolean_from_float +Pushes FALSE if the top FLOAT is 0.0, and TRUE otherwise +## :boolean_from_integer +Pushes FALSE if the top INTEGER is 0, and TRUE otherwise +# code.cljc + +## :code_append +Concatenates the top two instructions on the :code stack and pushes the result back onto the stack +## :exec_do_range +Executes the top EXEC instruction (i.e. loops) a number of times determined by the top two INTEGERs, while also pushing the loop counter onto the INTEGER stack. The top INTEGER is the "destination index" and the second INTEGER is the "current index". If the integers are equal, then the current index is pushed onto the INTEGER stack and the code (which is the "body" of the loop) is pushed onto the EXEC stack for subsequent execution. If the integers are not equal, then the current index will still be pushed onto the INTEGER stack but two items will be pushed onto the EXEC stack - first a recursive call to :exec_do_range (with the same code and destination index, but with a current index that has been either incremented or decremented by 1 to be closer to the destination index) and then the body code. Note that the range is inclusive of both endpoints a call with integer arguments 3 and 5 will cause its body to be executed 3 times, with the loop counter having the values 3, 4, and 5. Note also that one can specify a loop that "counts down" by providing a destination index that is less than the specified current index. +## :exec_do_count +Executes the top EXEC instruction (i.e. loops) a number of times determined by the top INTEGER, pushing an index (which runs from 0 to one less than the total number of iterations) onto the INTEGER stack prior to each execution of the loop body. If the top INTEGER argument is <= 0, this becomes a NOOP +## :exec_do_times +Like :exec_do_count, but does not push the loop counter onto the INTEGER stack +## :exec_if +If the top BOOLEAN is TRUE, removes the the second item on the EXEC stack, leaving the first item to be executed. Otherwise, removes the first item, leaving the second to be executed. Acts as a NOOP unless there are at least two items on the EXEC stack and one item on the BOOLEAN stack +## :exec_when +If the top BOOLEAN is TRUE, leaves the first item on the EXEC stack to be executed. Otherwise, it removes it. Acts as a NOOP unless there is at least one item on the EXEC stack and one item on the BOOLEAN stack +## :exec_while +Keeps executing the top instruction on the EXEC stack while the top item on the BOOLEAN stack is true +## :exec_do_while +Keeps executing the top instruction on the EXEC stack while the top item on the BOOLEAN stack is true. Differs from :exec_while in that it executes the top instruction at least once +## :exec_k +The "K combinator" - removes the second item on the EXEC stack +## :exec_s +The "S combinator" - pops 3 items from the EXEC stack, which we will call A, B, and C (with A being the first one popped), and then pushes a list containing B and C back onto the EXEC stack, followed by another instance of C, followed by another instance of A +## :exec_y +The "Y combinator" - inserts beneath the top item of the EXEC stack a new item of the form "(:exec_y TOP_ITEM)" \ No newline at end of file diff --git a/src/propeller/push/instructions/bool.cljc b/src/propeller/push/instructions/bool.cljc index f34ea56..ef2138a 100755 --- a/src/propeller/push/instructions/bool.cljc +++ b/src/propeller/push/instructions/bool.cljc @@ -1,5 +1,7 @@ (ns propeller.push.instructions.bool - "BOOLEAN Instructions, created with `propeller.push.instructions/def-instruction`" + "BOOLEAN Instructions, created with `propeller.push.instructions/def-instruction`. + List of instructions can be found at [Additional Instructions](Additional_Instructions.md)." + {:doc/format :markdown} (:require [propeller.push.instructions :refer [def-instruction make-instruction]])) diff --git a/src/propeller/push/instructions/character.cljc b/src/propeller/push/instructions/character.cljc index a66f6ba..dc4c71a 100755 --- a/src/propeller/push/instructions/character.cljc +++ b/src/propeller/push/instructions/character.cljc @@ -1,5 +1,6 @@ (ns propeller.push.instructions.character - "CHAR Instructions, created with `propeller.push.instructions/def-instruction`" + "CHAR Instructions, created with `propeller.push.instructions/def-instruction`. + List of instructions can be found at [Additional Instructions](Additional_Instructions.md)." (:require [propeller.push.state :as state] [propeller.tools.character :as char] [propeller.push.instructions :refer [def-instruction diff --git a/src/propeller/push/instructions/code.cljc b/src/propeller/push/instructions/code.cljc index 242ba42..165fc67 100755 --- a/src/propeller/push/instructions/code.cljc +++ b/src/propeller/push/instructions/code.cljc @@ -1,5 +1,6 @@ (ns propeller.push.instructions.code - "CODE Instructions, created with `propeller.push.instructions/def-instruction`" + "CODE Instructions, created with `propeller.push.instructions/def-instruction`. + List of instructions can be found at [Additional Instructions](Additional_Instructions.md)." (:require [propeller.utils :as utils] [propeller.push.state :as state] [propeller.push.instructions :refer [def-instruction diff --git a/src/propeller/push/instructions/input_output.cljc b/src/propeller/push/instructions/input_output.cljc index e31a532..b8c5b5d 100755 --- a/src/propeller/push/instructions/input_output.cljc +++ b/src/propeller/push/instructions/input_output.cljc @@ -1,5 +1,6 @@ (ns propeller.push.instructions.input-output - "INPUT and OUTPUT Instructions" + "INPUT and OUTPUT Instructions. + Additional instructions can be found at [Additional Instructions](Additional_Instructions.md)." (:require [propeller.push.state :as state] [propeller.push.instructions :refer [def-instruction generate-instructions]])) @@ -27,6 +28,7 @@ ;; OUTPUT Instructions ;; ============================================================================= +;; Prints new line (def-instruction :print_newline ^{:stacks [:print]} diff --git a/src/propeller/push/instructions/numeric.cljc b/src/propeller/push/instructions/numeric.cljc index c101693..7896e8c 100755 --- a/src/propeller/push/instructions/numeric.cljc +++ b/src/propeller/push/instructions/numeric.cljc @@ -1,5 +1,6 @@ (ns propeller.push.instructions.numeric - "FLOAT and INTEGER Instructions (polymorphic)" + "FLOAT and INTEGER Instructions (polymorphic). + Additional instructions can be found at [Additional Instructions](Additional_Instructions.md)." (:require [propeller.tools.math :as math] [propeller.push.instructions :refer [def-instruction generate-instructions diff --git a/src/propeller/push/instructions/string.cljc b/src/propeller/push/instructions/string.cljc index 48acf64..1a75721 100755 --- a/src/propeller/push/instructions/string.cljc +++ b/src/propeller/push/instructions/string.cljc @@ -1,5 +1,6 @@ (ns propeller.push.instructions.string - "STRING Instructions, created with `propeller.push.instructions/def-instruction`" + "STRING Instructions, created with `propeller.push.instructions/def-instruction`. + List of instructions can be found at [Additional Instructions](Additional_Instructions.md)." (:require [clojure.string :as string] [propeller.push.state :as state] [propeller.push.instructions :refer [def-instruction