diff --git a/docs/A_Guide_To_Propeller.html b/docs/A_Guide_To_Propeller.html index fea4005..9e584de 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/Adding_Genetic_Operators.html b/docs/Adding_Genetic_Operators.html index 704e915..62b56dd 100644 --- a/docs/Adding_Genetic_Operators.html +++ b/docs/Adding_Genetic_Operators.html @@ -1,6 +1,6 @@ -Adding Genetic Operators

Adding Genetic Operators

+Adding Genetic Operators

Adding Genetic Operators

In addition to the already-included genetic operators, you can add your own!

Variation Genetic Operators

    diff --git a/docs/Adding_Problem.html b/docs/Adding_Problem.html index 0abc369..c738a5e 100644 --- a/docs/Adding_Problem.html +++ b/docs/Adding_Problem.html @@ -1,6 +1,6 @@ -Adding a Problem

    Adding a Problem

    +Adding a Problem

    Adding a Problem

    In general, a problem file has 3 components: train-and-test-data, instructions, error-function, and -main.

    1. To add a new problem, you need training and test data. For Problem Synthesis Benchmark Problems (PSB2), you can fetch datasets using psb2.core/fetch-examples.
    2. diff --git a/docs/Adding_Selection_Method.html b/docs/Adding_Selection_Method.html index 6c78862..5e74540 100644 --- a/docs/Adding_Selection_Method.html +++ b/docs/Adding_Selection_Method.html @@ -1,17 +1,17 @@ -Adding a Selection Method

      Adding a Selection Method

      +Adding a Selection Method

      Adding a Selection Method

      1. Define a selection method function in propeller.selection that selects an individual from the population
      2. Add the selection method in propeller.selection/select-parent under the case call:
      3. - +
       (defn select-parent
        "Selects a parent from the population using the specified method."
        [pop argmap]
        (case (:parent-selection argmap)
        :new-selection-method (new-selection-method )))
       
      - +
      1. When runnning a problem, specify the selection method in :parent-selection. For example:
        lein run -m propeller.problems.simple-regression :parent-selection :new-selection-method"
         
        diff --git a/docs/index.html b/docs/index.html index b428a98..bca8599 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,7 +1,8 @@ -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

        Public variables and functions:

        propeller.problems.PSB2.basement

        BASEMENT from PSB2

        +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

        FIXME: write docs

        +

        Public variables and functions:

        propeller.problems.PSB2.camel-case

        CAMEL CASE from PSB2

        @@ -20,15 +21,29 @@

        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.string-classification

        String Classification:

        +

        Public variables and functions:

        propeller.problems.software.smallest

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

        +

        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

        Public variables and functions:

          propeller.push.instructions.character

          Push instructions for CHARs.

          -

          Public variables and functions:

            propeller.push.instructions.code

            Push instructions for code.

            -

            Public variables and functions:

              propeller.push.instructions.input-output

              Push instructions for input and output.

              -

              Public variables and functions:

              propeller.push.instructions.string

              Public variables and functions:

                propeller.push.instructions.vector

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

                -

                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.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.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.numeric

                      FLOAT and INTEGER Instructions (polymorphic)

                      +

                      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

                      +

                      Public variables and functions:

                        propeller.push.instructions.vector

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

                        +

                        propeller.push.interpreter

                        FIXME: write docs

                        +

                        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.

                        +

                        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.simplification

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

                        -

                        propeller.tools.calculus

                        Public variables and functions:

                        propeller.utils

                        Useful functions.

                        +

                        propeller.tools.calculus

                        FIXME: write docs

                        +

                        Public variables and functions:

                        propeller.tools.character

                        FIXME: write docs

                        +

                        Public variables and functions:

                        propeller.tools.distributions

                        FIXME: write docs

                        +

                        Public variables and functions:

                        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.

                        \ No newline at end of file diff --git a/docs/propeller.genome.html b/docs/propeller.genome.html index 5b96e01..94d2ac9 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 23e80ff..b68b59b 100644 --- a/docs/propeller.gp.html +++ b/docs/propeller.gp.html @@ -1,6 +1,7 @@ -propeller.gp documentation

                        propeller.gp

                        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.

                        +propeller.gp documentation

                        propeller.gp

                        FIXME: write docs

                        +

                        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.

                        Then, it checks if the total error of the best individual is less than or equal to the solution-error-threshold or if the current generation is greater than or equal to the max-generations specified. If either is true, the function exits with the best individual or nil. If not, it creates new individuals for the next generation using the variation/new-individual function and the repeatedly function, and then continues to the next iteration of the loop.

                        diff --git a/docs/propeller.problems.PSB2.basement.html b/docs/propeller.problems.PSB2.basement.html index 5d4ef0e..3f8c928 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 80e6686..b020232 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 0124beb..aa20f61 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 2564276..7a43f12 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 036b9c4..ce3daa1 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 4d97faa..7be4884 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 5897ed0..9bcebbb 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 170e2e1..25215d1 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 f574c64..06b5a66 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 e3543a1..f128d55 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 cebf5eb..27f175d 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 52b4e26..1486483 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 5ed8514..d9ebeb5 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 5931c97..02d1fca 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 c084687..41331b7 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 9a4fbe5..5ff09b9 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 2b3d771..c20b7f5 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 efb8c3c..74c1b6d 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 f091d09..cda64b8 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 ee6ea1f..cd7bd74 100644 --- a/docs/propeller.problems.software.number-io.html +++ b/docs/propeller.problems.software.number-io.html @@ -1,4 +1,13 @@ -propeller.problems.software.number-io documentation

                        propeller.problems.software.number-io

                        -main

                        (-main & args)

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

                        -

                        error-function

                        (error-function argmap data individual)

                        instructions

                        random-float

                        (random-float)

                        random-int

                        (random-int)

                        train-and-test-data

                        \ No newline at end of file +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.

                        +

                        -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 the absolute difference between program output and the correct output. The behavior is here defined as the final top item on the PRINT stack.

                        +

                        instructions

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

                        +

                        random-float

                        (random-float)

                        Random float between -100.0 and 100.0

                        +

                        random-int

                        (random-int)

                        Random integer between -100 and 100

                        +

                        train-and-test-data

                        Inputs are random integers and random floats and outputs are the sum as a float.

                        +
                        \ No newline at end of file diff --git a/docs/propeller.problems.software.smallest.html b/docs/propeller.problems.software.smallest.html index 3e81bef..6e98d8d 100644 --- a/docs/propeller.problems.software.smallest.html +++ b/docs/propeller.problems.software.smallest.html @@ -1,4 +1,16 @@ -propeller.problems.software.smallest documentation

                        propeller.problems.software.smallest

                        -main

                        (-main & args)

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

                        -

                        error-function

                        (error-function argmap data individual)

                        instructions

                        random-int

                        (random-int)

                        train-and-test-data

                        \ No newline at end of file +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.
                        +
                        + doi: 10.1109/TSE.2015.2454513
                        +
                        +

                        This problem file defines the following problem: takes as input four ints, computes the smallest, and prints to the screen the smallest input.

                        +
                        +

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

                        +

                        instructions

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

                        +

                        random-int

                        (random-int)

                        Random integer between -100 and 100

                        +

                        train-and-test-data

                        Inputs are 4-tuples of random integers and the outputs are the minimum value of each tuple.

                        +
                        \ No newline at end of file diff --git a/docs/propeller.problems.string-classification.html b/docs/propeller.problems.string-classification.html index dac076e..4d87e45 100644 --- a/docs/propeller.problems.string-classification.html +++ b/docs/propeller.problems.string-classification.html @@ -1,10 +1,10 @@ -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.

                        -

                        instructions

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

                        +

                        instructions

                        Set of original propel instructions

                        train-and-test-data

                        Training data: “GCG” “GACAG” “AGAAG” “CCCA” “GATTACA” “TAGG” “GACT” with associated boolean values based on problem definition.

                        Test data: “GCGT” “GACTTAG” “AGTAAG” “TCCTCA” “GAACA” “AGG” “GAC” with associated boolean values based on problem definition.

                        \ No newline at end of file diff --git a/docs/propeller.problems.valiant.html b/docs/propeller.problems.valiant.html index a7195f5..578a250 100644 --- a/docs/propeller.problems.valiant.html +++ b/docs/propeller.problems.valiant.html @@ -1,5 +1,12 @@ -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)

                        instructions

                        num-inputs

                        num-test

                        num-train

                        num-vars

                        train-and-test-data

                        \ No newline at end of file +

                        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.

                        +

                        num-inputs

                        FIXME: write docs

                        +

                        num-test

                        FIXME: write docs

                        +

                        num-train

                        FIXME: write docs

                        +

                        num-vars

                        FIXME: write docs

                        +

                        train-and-test-data

                        Inputs are num-train random boolean values and outputs are the even parity of a subset of input variables.

                        +
                        \ No newline at end of file diff --git a/docs/propeller.push.instructions.bool.html b/docs/propeller.push.instructions.bool.html index c09fd81..0eeb003 100644 --- a/docs/propeller.push.instructions.bool.html +++ b/docs/propeller.push.instructions.bool.html @@ -1,3 +1,4 @@ -propeller.push.instructions.bool documentation

                        propeller.push.instructions.bool

                        \ No newline at end of file +propeller.push.instructions.bool documentation

                        propeller.push.instructions.bool

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

                        +
                        \ No newline at end of file diff --git a/docs/propeller.push.instructions.character.html b/docs/propeller.push.instructions.character.html index cfb417f..4a42733 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

                        Push instructions for CHARs.

                        +propeller.push.instructions.character documentation

                        propeller.push.instructions.character

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

                        \ No newline at end of file diff --git a/docs/propeller.push.instructions.code.html b/docs/propeller.push.instructions.code.html index 11af35a..f0e69fb 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

                        Push instructions for code.

                        +propeller.push.instructions.code documentation

                        propeller.push.instructions.code

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

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

                        propeller.push.instructions

                        cls->type

                        def-instruction

                        (def-instruction instruction function)

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

                        +propeller.push.instructions documentation

                        propeller.push.instructions

                        FIXME: write docs

                        +

                        cls->type

                        FIXME: write docs

                        +

                        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.

                        get-stack-instructions

                        (get-stack-instructions stacks)

                        Given a set of stacks, returns all instructions that operate on those stacks only. Won’t include random instructions unless :random is in the set as well

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

                        propeller.push.instructions.input-output

                        Push instructions for input and output.

                        -

                        _print

                        handle-input-instruction

                        (handle-input-instruction state instruction)
                        \ No newline at end of file +propeller.push.instructions.input-output documentation

                        propeller.push.instructions.input-output

                        INPUT and OUTPUT 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 6c7e9fd..db6b871 100644 --- a/docs/propeller.push.instructions.numeric.html +++ b/docs/propeller.push.instructions.numeric.html @@ -1,3 +1,20 @@ -propeller.push.instructions.numeric documentation

                        propeller.push.instructions.numeric

                        _add

                        _dec

                        _from_boolean

                        _from_char

                        _from_string

                        _gt

                        _gte

                        _inc

                        _lt

                        _lte

                        _max

                        _min

                        _mod

                        _mult

                        _quot

                        _subtract

                        \ No newline at end of file +propeller.push.instructions.numeric documentation

                        propeller.push.instructions.numeric

                        FLOAT and INTEGER Instructions (polymorphic)

                        +

                        _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

                        +

                        _from_char

                        Pushes the ASCII value of the top CHAR

                        +

                        _from_string

                        Pushes the value of the top STRING, if it can be parsed as a number. Otherwise, acts as a NOOP

                        +

                        _gt

                        Pushes TRUE onto the BOOLEAN stack if the first item is greater than the second item, and FALSE otherwise

                        +

                        _gte

                        Pushes TRUE onto the BOOLEAN stack if the second item is greater than or equal to the top item, and FALSE otherwise

                        +

                        _inc

                        Pushes the increment (i.e. +1) of the top item of the stack

                        +

                        _lt

                        Pushes TRUE onto the BOOLEAN stack if the second item is less than the top item, and FALSE otherwise

                        +

                        _lte

                        Pushes TRUE onto the BOOLEAN stack if the second item is less than or equal to the top item, and FALSE otherwise

                        +

                        _max

                        Pushes the maximum of the top two items

                        +

                        _min

                        Pushes the minimum of the top two items

                        +

                        _mod

                        Pushes the top item modulo the second item onto the same stack. If the second item is zero, pushes 1. The modulus is computed as the remainder of the quotient, where the quotient has first been truncated towards negative infinity.

                        +

                        _mult

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

                        +

                        _quot

                        Pushes the quotient of the top two items (i.e. the first item divided by the second item) onto the same stack. If the second item is zero, pushes 1

                        +

                        _subtract

                        Pushes the difference of the top two items (i.e. the second item minus the top item) onto the same stack

                        +
                        \ No newline at end of file diff --git a/docs/propeller.push.instructions.polymorphic.html b/docs/propeller.push.instructions.polymorphic.html index 07071e0..ab04446 100644 --- a/docs/propeller.push.instructions.polymorphic.html +++ b/docs/propeller.push.instructions.polymorphic.html @@ -1,3 +1,18 @@ -propeller.push.instructions.polymorphic documentation

                        propeller.push.instructions.polymorphic

                        _deep_dup

                        _dup

                        _dup_items

                        _dup_times

                        _empty

                        _eq

                        _flush

                        _pop

                        _rot

                        _shove

                        _stack_depth

                        _swap

                        _yank

                        _yank_dup

                        \ No newline at end of file +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

                        FIXME: write docs

                        +

                        _dup

                        FIXME: write docs

                        +

                        _dup_items

                        FIXME: write docs

                        +

                        _dup_times

                        FIXME: write docs

                        +

                        _empty

                        FIXME: write docs

                        +

                        _eq

                        FIXME: write docs

                        +

                        _flush

                        FIXME: write docs

                        +

                        _pop

                        FIXME: write docs

                        +

                        _rot

                        FIXME: write docs

                        +

                        _shove

                        FIXME: write docs

                        +

                        _stack_depth

                        FIXME: write docs

                        +

                        _swap

                        FIXME: write docs

                        +

                        _yank

                        FIXME: write docs

                        +

                        _yank_dup

                        FIXME: write docs

                        +
                        \ No newline at end of file diff --git a/docs/propeller.push.instructions.string.html b/docs/propeller.push.instructions.string.html index bf01d10..d0fc696 100644 --- a/docs/propeller.push.instructions.string.html +++ b/docs/propeller.push.instructions.string.html @@ -1,3 +1,4 @@ -propeller.push.instructions.string documentation

                        propeller.push.instructions.string

                        \ No newline at end of file +propeller.push.instructions.string documentation

                        propeller.push.instructions.string

                        STRING Instructions

                        +
                        \ No newline at end of file diff --git a/docs/propeller.push.instructions.vector.html b/docs/propeller.push.instructions.vector.html index f05faf8..7a247de 100644 --- a/docs/propeller.push.instructions.vector.html +++ b/docs/propeller.push.instructions.vector.html @@ -1,4 +1,25 @@ -propeller.push.instructions.vector documentation

                        propeller.push.instructions.vector

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

                        -

                        _butlast

                        _concat

                        _conj

                        _contains

                        _emptyvector

                        _first

                        _indexof

                        _iterate

                        _last

                        _length

                        _nth

                        _occurrencesof

                        _pushall

                        _remove

                        _replace

                        _replacefirst

                        _rest

                        _reverse

                        _set

                        _subvec

                        _take

                        \ No newline at end of file +propeller.push.instructions.vector documentation

                        propeller.push.instructions.vector

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

                        +

                        _butlast

                        FIXME: write docs

                        +

                        _concat

                        FIXME: write docs

                        +

                        _conj

                        FIXME: write docs

                        +

                        _contains

                        FIXME: write docs

                        +

                        _emptyvector

                        FIXME: write docs

                        +

                        _first

                        FIXME: write docs

                        +

                        _indexof

                        FIXME: write docs

                        +

                        _iterate

                        FIXME: write docs

                        +

                        _last

                        FIXME: write docs

                        +

                        _length

                        FIXME: write docs

                        +

                        _nth

                        FIXME: write docs

                        +

                        _occurrencesof

                        FIXME: write docs

                        +

                        _pushall

                        FIXME: write docs

                        +

                        _remove

                        FIXME: write docs

                        +

                        _replace

                        FIXME: write docs

                        +

                        _replacefirst

                        FIXME: write docs

                        +

                        _rest

                        FIXME: write docs

                        +

                        _reverse

                        FIXME: write docs

                        +

                        _set

                        FIXME: write docs

                        +

                        _subvec

                        FIXME: write docs

                        +

                        _take

                        FIXME: write docs

                        +
                        \ No newline at end of file diff --git a/docs/propeller.push.interpreter.html b/docs/propeller.push.interpreter.html index 247e953..b9bab00 100644 --- a/docs/propeller.push.interpreter.html +++ b/docs/propeller.push.interpreter.html @@ -1,5 +1,6 @@ -propeller.push.interpreter documentation

                        propeller.push.interpreter

                        interpret-one-step

                        (interpret-one-step state)

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

                        +propeller.push.interpreter documentation

                        propeller.push.interpreter

                        FIXME: write docs

                        +

                        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 d0849f1..09c134f 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 ccd44ee..f6afa3c 100644 --- a/docs/propeller.push.state.html +++ b/docs/propeller.push.state.html @@ -1,3 +1,19 @@ -propeller.push.state documentation

                        propeller.push.state

                        empty-stack?

                        (empty-stack? state stack)

                        empty-state

                        example-state

                        get-args-from-stacks

                        (get-args-from-stacks state stacks)

                        peek-stack

                        (peek-stack state stack)

                        peek-stack-many

                        (peek-stack-many state stack n)

                        pop-stack

                        (pop-stack state stack)

                        pop-stack-many

                        (pop-stack-many state stack n)

                        print-state

                        (print-state state)

                        push-to-stack

                        (push-to-stack state stack item)

                        push-to-stack-many

                        (push-to-stack-many state stack items)

                        stack-limiter

                        stack-size

                        (stack-size state stack)

                        stacks

                        vec-stacks

                        \ No newline at end of file +propeller.push.state documentation

                        propeller.push.state

                        FIXME: write docs

                        +

                        empty-stack?

                        (empty-stack? state stack)

                        FIXME: write docs

                        +

                        empty-state

                        FIXME: write docs

                        +

                        example-state

                        FIXME: write docs

                        +

                        get-args-from-stacks

                        (get-args-from-stacks state stacks)

                        FIXME: write docs

                        +

                        peek-stack

                        (peek-stack state stack)

                        FIXME: write docs

                        +

                        peek-stack-many

                        (peek-stack-many state stack n)

                        FIXME: write docs

                        +

                        pop-stack

                        (pop-stack state stack)

                        FIXME: write docs

                        +

                        pop-stack-many

                        (pop-stack-many state stack n)

                        FIXME: write docs

                        +

                        print-state

                        (print-state state)

                        FIXME: write docs

                        +

                        push-to-stack

                        (push-to-stack state stack item)

                        FIXME: write docs

                        +

                        push-to-stack-many

                        (push-to-stack-many state stack items)

                        FIXME: write docs

                        +

                        stack-limiter

                        FIXME: write docs

                        +

                        stack-size

                        (stack-size state stack)

                        FIXME: write docs

                        +

                        stacks

                        FIXME: write docs

                        +

                        vec-stacks

                        FIXME: write docs

                        +
                        \ No newline at end of file diff --git a/docs/propeller.selection.html b/docs/propeller.selection.html index ab1ac91..124632a 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 9a49197..dfd9f44 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 1cd92e4..4fd71fc 100644 --- a/docs/propeller.tools.calculus.html +++ b/docs/propeller.tools.calculus.html @@ -1,5 +1,7 @@ -propeller.tools.calculus documentation

                        propeller.tools.calculus

                        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.

                        -

                        dx

                        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.

                        +propeller.tools.calculus documentation

                        propeller.tools.calculus

                        FIXME: write docs

                        +

                        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.

                        +

                        dx

                        FIXME: write docs

                        +

                        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 22b48d8..4a800fe 100644 --- a/docs/propeller.tools.character.html +++ b/docs/propeller.tools.character.html @@ -1,6 +1,7 @@ -propeller.tools.character documentation

                        propeller.tools.character

                        get-ascii

                        (get-ascii c)

                        Gets the ASCII code of a char

                        +propeller.tools.character documentation

                        propeller.tools.character

                        FIXME: write docs

                        +

                        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.

                        is-whitespace

                        (is-whitespace c)

                        Returns true if the given character is whitespace (newline, space, tab).

                        diff --git a/docs/propeller.tools.distributions.html b/docs/propeller.tools.distributions.html index 56eaa3c..6a9ca6b 100644 --- a/docs/propeller.tools.distributions.html +++ b/docs/propeller.tools.distributions.html @@ -1,6 +1,7 @@ -propeller.tools.distributions documentation

                        propeller.tools.distributions

                        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.

                        +propeller.tools.distributions documentation

                        propeller.tools.distributions

                        FIXME: write docs

                        +

                        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.

                        rand-norm

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

                        Generates n Normally-distributed random variables with given mean and standard deviation. If no parameters are provided, defaults to a single random observation from a Standard Normal distribution. Accepts an argument map with optional keys :n, :mu, and :sigma.

                        diff --git a/docs/propeller.tools.math.html b/docs/propeller.tools.math.html index 1e4ba89..6dbf522 100644 --- a/docs/propeller.tools.math.html +++ b/docs/propeller.tools.math.html @@ -1,16 +1,20 @@ -propeller.tools.math documentation

                        propeller.tools.math

                        abs

                        (abs x)

                        Returns the absolute value of a number.

                        -

                        approx=

                        (approx= x y epsilon)

                        ceil

                        (ceil x)

                        Returns the smallest integer greater than or equal to x.

                        +propeller.tools.math documentation

                        propeller.tools.math

                        FIXME: write docs

                        +

                        abs

                        (abs x)

                        Returns the absolute value of a number.

                        +

                        approx=

                        (approx= x y epsilon)

                        FIXME: write docs

                        +

                        ceil

                        (ceil x)

                        Returns the smallest integer greater than or equal to x.

                        cos

                        (cos x)

                        Returns the cosine of an angle (specified in radians).

                        div

                        (div x y)

                        Returns the result of floating point division between x and y.

                        -

                        E

                        exp

                        (exp x)

                        Returns Euler’s number (approx. 2.71) raised to the given power.

                        +

                        E

                        FIXME: write docs

                        +

                        exp

                        (exp x)

                        Returns Euler’s number (approx. 2.71) raised to the given power.

                        floor

                        (floor x)

                        Returns the largest integer less than or equal to x.

                        log

                        (log x base)(log x)

                        Returns the logarithm of x with the given base. If called with only one argument, returns the natural logarithm (base e) of the given value.

                        mean

                        (mean coll)

                        Returns the mean.

                        median

                        (median coll)

                        Returns the median.

                        median-absolute-deviation

                        (median-absolute-deviation coll)

                        Returns the median absolute deviation.

                        -

                        PI

                        pow

                        (pow x n)

                        Returns the value obtained by raising the first argument to the power of the second argument.

                        +

                        PI

                        FIXME: write docs

                        +

                        pow

                        (pow x n)

                        Returns the value obtained by raising the first argument to the power of the second argument.

                        root

                        (root x n)

                        Returns the root of x with base n.

                        round

                        (round x)

                        Returns the value of x rounded to the nearest integer.

                        sign

                        (sign x)

                        Returns the 1 if the argument is positive, -1 if the argument is negative, and 0 if the argument is zero.

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

                        propeller.tools.metrics

                        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

                        +propeller.tools.metrics documentation

                        propeller.tools.metrics

                        FIXME: write docs

                        +

                        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.

                        mean

                        (mean coll)

                        Returns the mean of a collection.

                        diff --git a/docs/propeller.utils.html b/docs/propeller.utils.html index b22c44e..7c9d392 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 14920f4..35b412a 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/project.clj b/project.clj index b1bbe31..f14def5 100644 --- a/project.clj +++ b/project.clj @@ -13,5 +13,5 @@ :jvm-opts ^:replace [] :plugins [[lein-codox "0.10.8"]] :codox {:output-path "docs" - :metadata {:doc/format :markdown} + :metadata {:doc "FIXME: write docs" :doc/format :markdown} :doc-paths ["src/docs_src"]}) diff --git a/src/propeller/problems/software/fizz_buzz.cljc b/src/propeller/problems/software/fizz_buzz.cljc index 7711510..b4183c2 100644 --- a/src/propeller/problems/software/fizz_buzz.cljc +++ b/src/propeller/problems/software/fizz_buzz.cljc @@ -1,4 +1,4 @@ -(ns propeller.problems.software.fizz-buzz +(ns ^:no-doc propeller.problems.software.fizz-buzz (:require [psb2.core :as psb2])) ;; @todo This namespace is never used an it isn't a complete problem. Furthermore fizz-buzz exists in the PSB2 folder. diff --git a/src/propeller/problems/software/number_io.cljc b/src/propeller/problems/software/number_io.cljc index a434a44..f6303b6 100755 --- a/src/propeller/problems/software/number_io.cljc +++ b/src/propeller/problems/software/number_io.cljc @@ -1,4 +1,10 @@ (ns 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. + " (:require [propeller.genome :as genome] [propeller.push.interpreter :as interpreter] [propeller.push.state :as state] @@ -34,12 +40,13 @@ ;; ============================================================================= ;; Random float between -100.0 and 100.0 -(defn random-float [] (- (* (rand) 200) 100.0)) +(defn random-float "Random float between -100.0 and 100.0" [] (- (* (rand) 200) 100.0)) ; Random integer between -100 and 100 -(defn random-int [] (- (rand-int 201) 100)) +(defn random-int "Random integer between -100 and 100" [] (- (rand-int 201) 100)) (def instructions + "Stack-specific instructions, input instructions, close, and constants" (utils/not-lazy (concat ;; stack-specific instructions @@ -50,6 +57,7 @@ (list random-float random-int)))) (def train-and-test-data + "Inputs are random integers and random floats and outputs are the sum as a float." (let [inputs (vec (repeatedly 1025 #(vector (random-int) (random-float)))) outputs (mapv #(apply + %) inputs) train-set {:inputs (take 25 inputs) @@ -60,6 +68,10 @@ :test test-set})) (defn error-function + "Finds the behaviors and errors of an individual: Error is the absolute difference between + program output and the correct output. + The behavior is here defined as the final top item on + the PRINT stack." [argmap data individual] (let [program (genome/plushy->push (:plushy individual) argmap) inputs (:inputs data) diff --git a/src/propeller/problems/software/smallest.cljc b/src/propeller/problems/software/smallest.cljc index 8c7a068..2009f50 100755 --- a/src/propeller/problems/software/smallest.cljc +++ b/src/propeller/problems/software/smallest.cljc @@ -1,4 +1,13 @@ (ns propeller.problems.software.smallest + "SMALLEST PROBLEM from C. Le Goues et al., + \"The ManyBugs and IntroClass Benchmarks\n + for Automated Repair of C Programs,\" in IEEE Transactions on Software\n + Engineering, vol. 41, no. 12, pp. 1236-1256, Dec. 1 2015.\n + doi: 10.1109/TSE.2015.2454513 + +This problem file defines the following problem: +takes as input four ints, computes the smallest, and prints to the screen the smallest input. +```" (:require [propeller.genome :as genome] [propeller.push.interpreter :as interpreter] [propeller.push.state :as state] @@ -12,20 +21,10 @@ ;; ;; SMALLEST PROBLEM ;; -;; 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. -;; ;; Problem Source: 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. ;; doi: 10.1109/TSE.2015.2454513 -;; -;; NOTE: input stack: in1 (int), -;; in2 (int), -;; in3 (int), -;; in4 (int), -;; output stack: printed output ;; ============================================================================= ;; ============================================================================= @@ -38,9 +37,10 @@ ;; ============================================================================= ; Random integer between -100 and 100 -(defn random-int [] (- (rand-int 201) 100)) +(defn random-int "Random integer between -100 and 100" [] (- (rand-int 201) 100)) (def instructions + "Stack-specific instructions, input instructions, close, and constants" (utils/not-lazy (concat ;; stack-specific instructions @@ -51,6 +51,7 @@ (list random-int)))) (def train-and-test-data + "Inputs are 4-tuples of random integers and the outputs are the minimum value of each tuple." (let [inputs (vec (repeatedly 1100 #(vector (random-int) (random-int) (random-int) (random-int)))) outputs (mapv #(apply min %) inputs) @@ -62,6 +63,10 @@ :test test-set})) (defn error-function + "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 PRINT stack." [argmap data individual] (let [program (genome/plushy->push (:plushy individual) argmap) inputs (:inputs data) diff --git a/src/propeller/problems/string_classification.cljc b/src/propeller/problems/string_classification.cljc index 480c7c5..5859eed 100755 --- a/src/propeller/problems/string_classification.cljc +++ b/src/propeller/problems/string_classification.cljc @@ -13,7 +13,7 @@ Given a string, return true if it contains A, C, G, and T. Else return false." ;; Set of original propel instructions (def instructions - "stack-specific instructions, input instructions, close, and constants" + "Set of original propel instructions" (list :in1 :integer_add :integer_subtract diff --git a/src/propeller/problems/valiant.cljc b/src/propeller/problems/valiant.cljc index 9f6cf6e..00c4a51 100644 --- a/src/propeller/problems/valiant.cljc +++ b/src/propeller/problems/valiant.cljc @@ -14,6 +14,8 @@ (def num-test 200) (def train-and-test-data + "Inputs are `num-train` random boolean values and outputs are the + even parity of a subset of input variables." (let [input-indices (take num-inputs (shuffle (range num-vars))) rand-vars (fn [] (vec (repeatedly num-vars #(< (rand) 0.5)))) even-parity? (fn [vars] @@ -25,7 +27,13 @@ {:train (map (fn [x] {:input1 x :output1 (vector (even-parity? x))}) train-inputs) :test (map (fn [x] {:input1 x :output1 (vector (even-parity? x))}) test-inputs)})) +;even-parity? takes in a list of variables and returns true if the number of true values in the input variables, +;as determined by the input-indices is even, and false otherwise. + (def 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." (vec (concat (for [i (range num-vars)] (keyword (str "in" i))) (take num-inputs (cycle [:boolean_xor @@ -37,6 +45,10 @@ ]))))) (defn error-function + "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." [argmap data individual] (let [program (genome/plushy->push (:plushy individual) argmap) inputs (map (fn [x] (:input1 x)) data) diff --git a/src/propeller/push/instructions/bool.cljc b/src/propeller/push/instructions/bool.cljc index c93d645..f34ea56 100755 --- a/src/propeller/push/instructions/bool.cljc +++ b/src/propeller/push/instructions/bool.cljc @@ -1,4 +1,5 @@ (ns propeller.push.instructions.bool + "BOOLEAN Instructions, created with `propeller.push.instructions/def-instruction`" (: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 4d967dc..a66f6ba 100755 --- a/src/propeller/push/instructions/character.cljc +++ b/src/propeller/push/instructions/character.cljc @@ -1,5 +1,5 @@ (ns propeller.push.instructions.character - "Push instructions for CHARs." + "CHAR Instructions, created with `propeller.push.instructions/def-instruction`" (: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 d022b72..242ba42 100755 --- a/src/propeller/push/instructions/code.cljc +++ b/src/propeller/push/instructions/code.cljc @@ -1,5 +1,5 @@ (ns propeller.push.instructions.code - "Push instructions for code." + "CODE Instructions, created with `propeller.push.instructions/def-instruction`" (: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 4c2aa18..e31a532 100755 --- a/src/propeller/push/instructions/input_output.cljc +++ b/src/propeller/push/instructions/input_output.cljc @@ -1,5 +1,5 @@ (ns propeller.push.instructions.input-output - "Push instructions for input and output." + "INPUT and OUTPUT Instructions" (:require [propeller.push.state :as state] [propeller.push.instructions :refer [def-instruction generate-instructions]])) @@ -12,6 +12,9 @@ ;; elements thus labeled from the :input map and pushing them onto the :exec ;; stack. (defn handle-input-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." [state instruction] (if (contains? (:input state) instruction) (let [input (instruction (:input state))] @@ -33,6 +36,7 @@ (state/push-to-stack popped-state :print (str current-output \newline))))) (def _print + "Instruction to print output." ^{:stacks [:print] :name "_print"} (fn [stack state] diff --git a/src/propeller/push/instructions/numeric.cljc b/src/propeller/push/instructions/numeric.cljc index 059e781..c101693 100755 --- a/src/propeller/push/instructions/numeric.cljc +++ b/src/propeller/push/instructions/numeric.cljc @@ -1,4 +1,5 @@ (ns propeller.push.instructions.numeric + "FLOAT and INTEGER Instructions (polymorphic)" (:require [propeller.tools.math :as math] [propeller.push.instructions :refer [def-instruction generate-instructions @@ -11,6 +12,8 @@ ;; Pushes TRUE onto the BOOLEAN stack if the first item is greater than the second ;; item, and FALSE otherwise (def _gt + "Pushes TRUE onto the BOOLEAN stack if the first item is greater + than the second item, and FALSE otherwise" ^{:stacks #{:boolean} :name "_gt"} (fn [stack state] @@ -19,6 +22,8 @@ ;; Pushes TRUE onto the BOOLEAN stack if the second item is greater than or ;; equal to the top item, and FALSE otherwise (def _gte + "Pushes TRUE onto the BOOLEAN stack if the second item is greater than or + equal to the top item, and FALSE otherwise" ^{:stacks #{:boolean} :name "_gte"} (fn [stack state] @@ -27,6 +32,8 @@ ;; Pushes TRUE onto the BOOLEAN stack if the second item is less than the top ;; item, and FALSE otherwise (def _lt + "Pushes TRUE onto the BOOLEAN stack if the second item is less than the top + item, and FALSE otherwise" ^{:stacks #{:boolean} :name "_lt"} (fn [stack state] @@ -35,6 +42,8 @@ ;; Pushes TRUE onto the BOOLEAN stack if the second item is less than or equal ;; to the top item, and FALSE otherwise (def _lte + "Pushes TRUE onto the BOOLEAN stack if the second item is less than or equal + to the top item, and FALSE otherwise" ^{:stacks #{:boolean} :name "_lte"} (fn [stack state] @@ -42,6 +51,7 @@ ;; Pushes the sum of the top two items onto the same stack (def _add + "Pushes the sum of the top two items onto the same stack" ^{:stacks #{} :name "_add"} (fn [stack state] @@ -51,6 +61,8 @@ ;; Pushes the difference of the top two items (i.e. the second item minus the ;; top item) onto the same stack (def _subtract + "Pushes the difference of the top two items (i.e. the second item minus the + top item) onto the same stack" ^{:stacks #{} :name "_subtract"} (fn [stack state] @@ -59,6 +71,7 @@ ;; Pushes the product of the top two items onto the same stack (def _mult + "Pushes the product of the top two items onto the same stack" ^{:stacks #{} :name "_mult"} (fn [stack state] @@ -68,6 +81,8 @@ ;; Pushes the quotient of the top two items (i.e. the first item divided by the ;; second item) onto the same stack. If the second item is zero, pushes 1 (def _quot + "Pushes the quotient of the top two items (i.e. the first item divided by the + second item) onto the same stack. If the second item is zero, pushes 1" ^{:stacks #{} :name "_quot"} (fn [stack state] @@ -78,6 +93,10 @@ ;; quotient, where the quotient has first been truncated towards negative ;; infinity. (def _mod + "Pushes the top item modulo the second item onto the same stack. If the second + item is zero, pushes 1. The modulus is computed as the remainder of the + quotient, where the quotient has first been truncated towards negative + infinity." ^{:stacks #{} :name "_mod"} (fn [stack state] @@ -85,6 +104,7 @@ ;; Pushes the maximum of the top two items (def _max + "Pushes the maximum of the top two items" ^{:stacks #{} :name "_max"} (fn [stack state] @@ -92,6 +112,7 @@ ;; Pushes the minimum of the top two items (def _min + "Pushes the minimum of the top two items" ^{:stacks #{} :name "_min"} (fn [stack state] @@ -99,6 +120,7 @@ ;; Pushes 1 / 1.0 if the top BOOLEAN is TRUE, or 0 / 0.0 if FALSE (def _from_boolean + "Pushes 1 / 1.0 if the top BOOLEAN is TRUE, or 0 / 0.0 if FALSE" ^{:stacks #{:boolean} :name "_from_boolean"} (fn [stack state] @@ -109,6 +131,7 @@ ;; Pushes the ASCII value of the top CHAR (def _from_char + "Pushes the ASCII value of the top CHAR" ^{:stacks #{:char} :name "_from_char"} (fn [stack state] @@ -117,6 +140,8 @@ ;; Pushes the value of the top STRING, if it can be parsed as a number. ;; Otherwise, acts as a NOOP (def _from_string + "Pushes the value of the top STRING, if it can be parsed as a number. +Otherwise, acts as a NOOP" ^{:stacks #{:string} :name "_from_string"} (fn [stack state] @@ -133,6 +158,7 @@ ;; Pushes the increment (i.e. +1) of the top item of the stack (def _inc + "Pushes the increment (i.e. +1) of the top item of the stack" ^{:stacks #{} :name "_inc"} (fn [stack state] diff --git a/src/propeller/push/instructions/polymorphic.cljc b/src/propeller/push/instructions/polymorphic.cljc index d744f3c..996f284 100755 --- a/src/propeller/push/instructions/polymorphic.cljc +++ b/src/propeller/push/instructions/polymorphic.cljc @@ -1,4 +1,5 @@ (ns propeller.push.instructions.polymorphic + "Polymorphic Instructions (for all stacks, with the exception of non-data ones like input and output)" (:require [propeller.utils :as utils] [propeller.push.state :as state] [propeller.push.limits :as limit] diff --git a/src/propeller/push/instructions/string.cljc b/src/propeller/push/instructions/string.cljc index b7450cd..c0afa4a 100755 --- a/src/propeller/push/instructions/string.cljc +++ b/src/propeller/push/instructions/string.cljc @@ -1,4 +1,5 @@ (ns propeller.push.instructions.string + "STRING Instructions" (:require [clojure.string :as string] [propeller.push.state :as state] [propeller.push.instructions :refer [def-instruction diff --git a/src/propeller/push/instructions/vector.cljc b/src/propeller/push/instructions/vector.cljc index 342cf95..1236716 100755 --- a/src/propeller/push/instructions/vector.cljc +++ b/src/propeller/push/instructions/vector.cljc @@ -1,5 +1,5 @@ (ns propeller.push.instructions.vector - "Vector instructions for all vector element subtypes: BOOLEAN, FLOAT, INTEGER, and STRING." + "VECTOR instructions for all vector element subtypes: BOOLEAN, FLOAT, INTEGER, and STRING." (:require [clojure.string] [propeller.utils :as utils] [propeller.push.state :as state] diff --git a/src/propeller/tools/math.cljc b/src/propeller/tools/math.cljc index 7fd463e..c364b54 100755 --- a/src/propeller/tools/math.cljc +++ b/src/propeller/tools/math.cljc @@ -1,9 +1,9 @@ (ns propeller.tools.math) -(defonce PI #?(:clj Math/PI +(defonce ^:no-doc PI #?(:clj Math/PI :cljs js/Math.PI)) -(defonce E #?(:clj Math/E +(defonce ^:no-doc E #?(:clj Math/E :cljs js/Math.PI)) (defn mean