Next: , Previous: , Up: Software Evolution Library Index   [Contents][Index]


A.1 SOFTWARE-EVOLUTION-LIBRARY/SOFTWARE-EVOLUTION-LIBRARY

Condition: mutate [sel]

Class precedence list: mutate, error, serious-condition, condition, slot-object, t

Mutation errors are thrown when a mutation fails. These may often be safely ignored. A common restart is ‘ignore-failed-mutation’.

Condition: no-mutation-targets [sel]

Class precedence list: no-mutation-targets, mutate, error, serious-condition, condition, slot-object, t

This is a particularly benign form of mutation error. A common restart is ‘ignore-failed-mutation’.

Class: oid-object [sel]

Class precedence list: oid-object, standard-object, slot-object, t

Attaches a unique oid (object identifier) to each instance.

Variable: *cross-chance* [sel]

Fraction of new individuals generated using crossover rather than mutation.

Variable: *crossover-stats* [sel]

Variable to hold crossover statistics.

Variable: *elitism* [sel]

Number of individuals to automatically promote to next population. Range: 0..(- (length *population*) 1) When evolving super-mutants, or calling generational-evolve, *elitism* specifies the number of individuals which are automatically promoted prior to typical generational replacement or eviction process. The selected individuals will be the ones with the best fitness. When using super-mutants, the *elitism* value will reduce the number of new individuals created in each generation by the value of *elitism* (since this number will automatically be promoted).

Variable: *fitness-evals* [sel]

Track the total number of fitness evaluations.

Variable: *fitness-predicate* [sel]

Function to compare two fitness values to select which is preferred.

Variable: *fitness-scalar-fn* [sel]

Function to convert fitness to a numeric value

Variable: *generations* [sel]

Holds the running generation count.

Variable: *max-population-size* [sel]

Maximum allowable population size.

Variable: *mcmc-fodder* [sel]

Holds the genome elements which may be used by ‘mcmc-step’. Should be initialized to a list of the unique possible genome elements.

Variable: *mut-rate* [sel]

Chance to mutate a new individual.

Variable: *mutation-improvements* [sel]

List of recent mutation improvements cons’d with *fitness-evals*.

Variable: *mutation-stats* [sel]

Variable to hold mutation statistics.

Variable: *population* [sel]

Holds the variant programs to be evolved. This variable may be read to inspect a running search process, or written to as part of a running search process.

Variable: *running* [sel]

True when a search process is running, set to nil to stop evolution.

Variable: *start-time* [sel]

Holds the start time of evolutionary processes.

Variable: *target-fitness-p* [sel]

Predicate indicating whether an individual has reached the target fitness.

Variable: *tie-breaker-predicate* [sel]

Function to compare two tie breaker values to select which is preferred.

Variable: *tournament-eviction-size* [sel]

Number of individuals to participate in eviction tournaments.

Variable: *tournament-selector* [sel]

Function used to select winners of a tournament. Returns a list of winners.

Variable: *tournament-size* [sel]

Number of individuals to participate in tournament selection.

Variable: *tournament-tie-breaker* [sel]

Function used to break ties in a tournament. Returns a single winner.

Variable: *worst-fitness* [sel]

Default worst fitness todo.

Variable: *worst-fitness-p* [sel]

Predicate indicating whether an individual has the worst possible fitness.

Variable: +software-evolution-library-branch+ [sel]

Current branch of the software-evolution-library.

Variable: +software-evolution-library-dir+ [sel]

Path to directory holding software-evolution-library.

Constant: +software-evolution-library-major-version+ [sel]

Current major version of the software-evolution-library (without git hash).

Variable: +software-evolution-library-version+ [sel]

Current version of the software-evolution-library.

Generic Function: apply-all-mutations [sel] software mutation

Apply mutation to every target in software. Returns the resulting software objects. Returns a list of the applied mutations as an optional second value.

Generic Function: apply-mutation [sel] software mutation

Apply mutation to software, return the resulting software object. Mutation application may destructively modify the software object, or it may return a new instance with the mutation applied, and leave the original untouched. Any client which calls apply-mutation should ensure that the result returned by apply-mutation is captured, and should not make assumptions about the state of the original.

Example: (let ((mutated-software (apply-mutation (copy software) mutation))) ...

Define an :around method on this function to record mutations.

Method: apply-mutation [sel] (range sw-range) (mutation simple-swap)

docfixme

Method: apply-mutation [sel] (range sw-range) (mutation simple-insert)

docfixme

Method: apply-mutation [sel] (range sw-range) (mutation simple-cut)

docfixme

Method: apply-mutation [sel] (simple simple) (mutation simple-swap)

docfixme

Method: apply-mutation [sel] (simple simple) (mutation simple-insert)

docfixme

Method: apply-mutation [sel] (simple simple) (mutation double-cut)

Cut two random elements of the genome. If the two elements indices are equal, this just becomes one simple-cut. Otherwise it is implemented as two simple-cut mutations, so derived mutations should only need to implement simple-cut.

Method: apply-mutation [sel] (simple simple) (mutation simple-cut)

docfixme

Method: apply-mutation [sel] (obj parseable) (op list)

Apply ops to software, returning the resulting software.

Method: apply-mutation [sel] (software parseable) (mutation parseable-mutation)

Apply mutation to software, returning the resulting software.

Method: apply-mutation [sel] (software clang) (mutation clang-mutation)

Apply mutation to software, returning the resulting software.

Method: apply-mutation [sel] (llvm llvm) op

docfixme

Method: apply-mutation [sel] (obj expression) (mutation random-subtree)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation double-half)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation subtract-add-tree)

docfixme

Method: apply-mutation [sel] (obj expression) (mut add-subtract-scope)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation add-subtract-tree)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation subtract-add)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation add-subtract)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation mult-divide)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation demote-binop-right)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation demote-binop-left)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation change-constant)

docfixme

Method: apply-mutation [sel] (obj expression) (mutation change-operator)

docfixme

Method: apply-mutation [sel] (elf elf-risc) mut

docfixme

Method: apply-mutation [sel] (elf elf-cisc) mut

docfixme

Method: apply-mutation [sel] (obj coq) (mutation type-safe-swap)

Apply a ‘type-safe-swap’ mutation to Coq object obj.

Method: after apply-mutation [sel] (obj clang-w-fodder) mutation

Inject fodder dependencies such as types, macros, and headers after a fodder mutation has been applied to obj.

Method: apply-mutation [sel] (cil cil) op

docfixme

Method: apply-mutation [sel] (asm asm-heap) (mutation asm-replace-operand)

Apply an asm-replace-operand mutation to asm-heap, return the resulting software. The mutation targets are a pair of instruction indices pointing to a "bad" instruction (whose operand will be replaced) and a "good" instruction (whose operand will be used as the replacement). If either instruction lacks an operand, a ‘no-mutation-targets’ condition is raised.

Method: apply-mutation [sel] (asm asm-heap) (mutation simple-swap)

Swap the values at two locations in ASM as specified by mutation.

Method: apply-mutation [sel] (asm asm-heap) (mutation simple-insert)

Insert a value into location of ASM as specified by mutation.

Method: apply-mutation [sel] (asm asm-heap) (mutation simple-cut)

Implement simple-cut mutation on asm-heap.

Method: apply-mutation [sel] (asm asm) (mutation asm-replace-operand)

Apply an asm-replace-operand mutation to ASM, return the resulting software. The mutation targets are a pair of instruction indices pointing to a "bad" instruction (whose operand will be replaced) and a "good" instruction (whose operand will be used as the replacement). If either instruction lacks an operand, a ‘no-mutation-targets’ condition is raised.

Method: before apply-mutation [sel] (obj ancestral) op &aux (target (targets op))

docfixme

Generic Function: apply-path [sel] software key path

Apply the execution trace path behind key in software.

Method: apply-path [sel] (elf elf-cisc) key addresses &aux applied

docfixme

Method: apply-path [sel] (asm asm) key addresses &aux applied

Apply a list of sampled addresses to the ASM’s genome behind key. If each element of addresses is a cons cell then assume the car is the address and the cdr is the value.

Generic Function: build-op [sel] mutation software

Build operation on software from a mutation.

Method: build-op [sel] (mutation parseable-nop) software

Return an association list with the operations to apply a ‘nop’ mutation to software.

Method: build-op [sel] (mutation parseable-cut) software

Return an association list with the operations to apply a ‘parseable-cut’ mutation to software.

Method: build-op [sel] (mutation parseable-replace) software

Return an association list with the operations to apply an ‘parseable-replace’ mutation to software.

Method: build-op [sel] (mutation parseable-move) software

Return an association list with the operations to apply a ‘parseable-move’ mutation to software.

Method: build-op [sel] (mutation parseable-swap) software

Return an association list with the operations to apply a ‘parseable-swap’ mutation to software.

Method: build-op [sel] (mutation parseable-insert) software

Return an association list with the operations to apply a ‘parseable-insert’ mutation to software.

Method: build-op [sel] (mutation rename-variable) software

Return an association list with the operations to apply a ‘rename-variable’ mutation to software.

Method: build-op [sel] (mutation cut-decl) clang

Return an association list with the operations to apply a ‘cut-decl’ mutation to clang.

Method: build-op [sel] (mutation coalesce-while-loop) (obj clang)

Return an association list with the operations to apply a ‘coalesce-while-loop’ mutation to software.

Method: build-op [sel] (mutation explode-for-loop) (obj clang)

Return an association list with the operations to apply an ‘explode-for-loop’ mutation to obj.

Method: build-op [sel] (mutation clang-promote-guarded) software &aux (guarded (targets mutation))

Return an association list with the operations to apply a ‘clang-promote-guarded’ mutation to software.

Method: build-op [sel] (mutation clang-swap) software

Return an association list with the operations to apply a ‘clang-swap’ mutation to software.

Method: build-op [sel] (mutation clang-insert) software

Return an association list with the operations to apply a ‘clang-insert’ mutation to software.

Method: build-op [sel] (mut insert-fodder-decl-rep) (obj clang-w-fodder)

Return an association list with the operations to apply a ‘insert-fodder-decl-rep’ mut to obj.

Generic Function: copy [sel] obj &key transform build-command artifacts evolve-files other-files ignore-paths only-paths ignore-other-paths only-other-paths component-class project-dir reference genome compiler flags mutants super-soft phenome-results begin end spelling-loc expansion-loc is-macro-arg-expansion file included-from line presumed-line col offset tok-len hash name body i-file type storage-class qual desugared modifiers array reqs decl referenceddecl path children class range id syn-ctx annotations asts includes types macros stmt-asts non-stmt-asts functions prototypes symbol-table name-symbol-table features feature-vecs feature-vec-meta linker raw-size shebang scope nop base sw-project addresses diffs diff-type project-file file-source imports coq-modules coq-sections coq-assumptions coq-definitions compilation-database input-spec output-spec untraced-call-spec var-table bss-segment target-name target-start-index target-end-index target-info target-lines static-link io-dir io-file data-path data-asm static-names page-block-list fitness-harness include-lines include-funcs libraries max-asm-function-size eval-meta-results linker-script limit-call line-heap function-index function-bounds-file super-owner asm-syntax addr-map ancestors git-repo &allow-other-keys

Generic copy method.

Method: around copy [sel] (ast functional-tree-ast) &rest keys

Wrapper around copy to transform all keyword arguments which are not explicit slot initargs into annotations for functional tree ASTs.

Method: around copy [sel] (obj file-w-attributes) &key &allow-other-keys

Wrap the copy method to ensure the OBJ’s fields are copied.

Method: around copy [sel] (obj file) &key &allow-other-keys

Wrap the copy method to ensure the OBJ’s fields are copied.

Method: before copy [sel] (obj clang) &key (genome nil genome-supplied-p) &allow-other-keys

Wrapper before copy to ensure all AST paths are populated in the genome supplied as a keyword.

Method: copy [sel] (asm asm-range) &key

Customized copy for ‘asm-range’ software objects. Ensures deep copies are made of the genome (ranges) but shallow copies are made of the reference base genome.

Generic Function: crossover [sel] software-a software-b

Crossover two software objects. Define an :around method on this function to record crossovers.

Method: crossover [sel] (a project) (b project)

Randomly pick a file in A and crossover with the corresponding file in b.

Method: crossover [sel] (a simple) (b simple)

docfixme

Method: crossover [sel] (a parseable) (b parseable)

Perform single-point crossover between two parseable software objects, and returning a new software object as the result. If an error occurs, returns nil. Algorithm: A random node of the tree ’a’ is chosen, its path calculated, and if there is a node at the corresponding path in ’b’, then that node will replace the corresponding node in the genome of ’a’. In order to update the genome of ’a’ the genome is copied and the resulting modified genome is stored in ’a’.

Method: crossover [sel] (a clang) (b clang)

docfixme

Method: crossover [sel] (a ir) (b ir)

Crossover two software objects, A and b.

Method: crossover [sel] (a elf-risc) (b elf-risc)

One point crossover.

Method: crossover [sel] (a elf-cisc) (b elf-cisc)

One point crossover.

Method: crossover [sel] (a asm) (b asm)

By default, crossover for ASM objects uses ‘homologous-crossover’.

Method: around crossover [sel] (a ancestral) (b ancestral)

docfixme

Macro: define-mutation [sel] class-name superclasses slots &rest options

Like ‘defclass’ but inherits targeter slot-options from mutation. Also, ensures mutation is a member of superclasses

Function: analyze-mutation [sel] obj mutation-info test

Default function to collect statistics from an applied mutation.

This function will calculate the improvements to the fitness of software as the result of crossover and mutation using ‘evaluate’ and test. Each crossover and mutation will be paired with one of the following tags; :dead, :same, :worse, or :better. Calculated stats will be added to the *crossover-stats* and *mutation-stats* variables for analysis.

Generic Function: apply-mutations [sel] software mutation n

Apply mutation to the first n targets in software. Returns the resulting software objects. Returns a list of the applied mutations as an optional second value.

Generic Function: apply-picked-mutations [sel] software mutation n

Apply mutation to n randomly selected targets in software. Returns the resulting software objects. Returns a list of the applied mutations as an optional second value.

Generic Function: at-targets [sel] mutation targets &key object &allow-other-keys

Return a copy of mutation with ‘targets’ set to targets.

Generic Function: create-super [sel] variant &optional rest-variants

Create a super-mutant populated with variant . rest-variants

Method: create-super [sel] (variant software) &optional rest-variants

Creates a super-mutant and populates variants. Returns the super-mutant.

Method: create-super [sel] (variant asm-heap) &optional rest-variants

Creates a asm-super-mutant and populates it with single variant.

Macro: define-software [sel] name direct-superclasses direct-slots &rest options

Define a new ‘software’ class name including a deep ‘copy’ method. Arguments name direct-superclasses and options are passed through to ‘defclass’ unmodified. Additional optional :copier property on each slot in direct-slots may be one of the following:

Generic Function: evaluate [sel] function software &rest extra-keys &key keep-fitness-executable keep-assembly-file &allow-other-keys

Evaluate the software returning a numerical fitness.

Method: evaluate [sel] (test function) (super super-mutant) &rest extra-keys &key &allow-other-keys

Evaluate super-mutant, setting fitness for all variants.

Method: evaluate [sel] (test symbol) (asm-super asm-super-mutant) &rest extra-keys &key (keep-fitness-executable *keep-fitness-executables*) (keep-assembly-file *keep-assembly-files*) &allow-other-keys

Create phenome (binary executable) and call it to generate fitness results. The variants need to already be created (stored in mutants slot) and the io-file needs to have been loaded, along with the var-table by parse-sanity-file.

Method: evaluate [sel] phenome (test-suite test-suite) &rest extra-keys &key &allow-other-keys

Evaluate all test-cases in test-suite aggregating their output. By default, sum the results of applying ‘evaluate’ to each test-case using ‘reduce’. Keyword arguments ‘:function’ and ‘:initial-value’ may be used as in ‘reduce’ to specify an aggregation function and starting value.

Method: evaluate [sel] phenome (obj test-case) &rest extra-keys &key &allow-other-keys

Run ‘test-case’ obj on phenome and return a fitness score (as opposed to the output and exit code returned by ‘finish-test‘). Default behavior is to return 1 if the exit code is 0 and 0 otherwise.

Override this method if you want to use other criteria, such as test output, to determine the fitness score.

‘start-test’ documentation for more information.

Generic Function: fitness-extra-data [sel] software

Hold extra data returned by the fitness function.

Generic Function: (setf fitness-extra-data [sel]) extra-data software

Pass extra data (optionally) returned by the fitness function to the software object.

Method: around (setf fitness-extra-data [sel]) extra-data (obj ancestral)

docfixme

Generic Function: from-file [sel] software file

Initialize software with contents of file.

Method: from-file [sel] (range sw-range) path

docfixme

Method: from-file [sel] (light light) path

docfixme

Method: from-file [sel] (obj parseable) path

Initialize obj with the contents of path.

Method: after from-file [sel] (obj file-w-attributes) path

Reading from a file sets original-genome-string.

Method: before from-file [sel] (obj file-w-attributes) path

Wrapper around the ‘from-file‘ method to store the file at PATH’s permissions and modification time when creating obj.

Method: after from-file [sel] (obj file) path

Reading from a file saves path.

Method: from-file [sel] (obj clang) path

Initialize obj with the contents of path.

Method: from-file [sel] (llvm llvm) path

docfixme

Method: from-file [sel] (obj ir) path

Initialize obj with the contents of path.

Method: from-file [sel] (forth forth) path &aux strings

Read forth script from path setting ‘genome’ and ‘shebang’.

Method: from-file [sel] (elf elf-risc) path

docfixme

Method: from-file [sel] (elf elf) path

docfixme

Method: from-file [sel] (elf elf-csurf) path

docfixme

Method: from-file [sel] (elf elf-cisc) path

docfixme

Method: from-file [sel] (obj coq) file

Load Coq obj from file file, initializing fields in obj. Resets the SerAPI process so that imports are loaded but no definitions from the file have been added.

Method: after from-file [sel] (asm asm-super-mutant) file

Set function target after the file loads.

Method: from-file [sel] (asm asm-heap) file

Initialize an ‘asm-heap’ software object from a file.

Method: from-file [sel] (asm asm-range) file

Initialize an ‘asm-range’ software object from a file. Note this is required as no ‘from-file’ method is defined on the ‘range’ software object class.

Method: after from-file [sel] (obj asm) file

Ensure ‘number-genome’ is called on all ASM files. This adds :id fields to genome elements required by ‘homologous-crossover’.

Method: before from-file [sel] (obj ancestral) path

docfixme

Method: from-file [sel] (obj pliny-database) db

Create a Pliny database using the contents of db

Generic Function: from-string [sel] software string

Initialize software with contents of string.

Method: from-string [sel] (obj parseable) string

Initialize obj with the contents of string.

Method: from-string [sel] (obj ir) string

Initialize obj with the contents of string.

Method: before from-string [sel] (obj clang-w-fodder) string

Ensure the fodder database has been initialized prior to creating a ‘clang-w-fodder’ software obj from string.

Method: before from-string [sel] (obj ancestral) string

docfixme

Method: from-string [sel] (obj pliny-database) arg

Parse a database argument in the form "<HOST|FILE>:PORT"

Class: mutation [sel]

Class precedence list: mutation, oid-object, standard-object, slot-object, t

Slots:

The base class of all software mutations.

Macro: compose-mutations [sel] class-name mutations &rest options

Define a new mutation named class-name composing mutations. mutations is a list of the names of mutation classes.

Function: classify [sel] new &rest old

Classify the fitness of new as :better, :worse, :same, or :dead when compared to old. new and old must have fitness populated.

Function: default-select-best [sel] group &key predicate

Return the members of group with most predicate fitness. Default selection function for ‘tournament’.

Function: fitness-equal-p [sel] fitness-a fitness-b

Return true if fitness-a and fitness-b are equal

Function: generational-evolve [sel] reproduce evaluate-pop select &key every-pre-fn every-post-fn analyze-mutation-fn test period period-fn max-generations max-evals max-time filter

Evolves ‘*population*’ using reproduce evaluate-pop and select.

Required arguments are as follows: reproduce ----------- create new individuals from the current population evaluate-pop -------- evaluate-pop the entire population select -------------- select best individuals from the population Keyword arguments are as follows: max-generations ----- stop after this many generations max-evals ----------- stop after this many fitness evaluations max-time ------------ stop after this many seconds period -------------- interval of generations evaluations to run period-fn period-fn ----------- function to run every period generations every-pre-fn -------- function to run on each new individual before evaluation every-post-fn ------- function to run on each new individual after evaluation analyze-mutation-fn - function to call to analyze mutation results test ---------------- fitness test function for mutation statistics filter -------------- remove individuals for which filter returns false

Generic Function: genome [sel] software

The software genotype or “code”, exposed as a simplified data structure. For example an AST genome, e.g., of a ‘cil’ or ‘lisp’ software object my have a tree structure while the genome of an ‘asm’ or ‘llvm’ software object will be a vector.

Method: genome [sel] (simple simple)

automatically generated reader method

Method: before genome [sel] (obj parseable)

Lazily parse the genome upon first access.

Method: genome [sel] (parseable parseable)

Lazily parsed AST representation of the code.

Method: genome [sel] (obj super-mutant)

Return a genome which combines all variants in super-mutant.

Method: genome [sel] (sexp sexp)

automatically generated reader method

Method: genome [sel] (ir ir)

automatically generated reader method

Method: genome [sel] (diff diff)

Build the genome on the fly from DIFF’s ‘reference’ and ‘diffs’.

Generic Function: genome-string [sel] software &optional stream

Return a string of the ‘genome’ of software.

Method: genome-string [sel] (obj project) &optional stream

Returns all genomes joined with separators, optionally writing to stream.

Method: genome-string [sel] (obj parseable) &optional stream

Return the source code of obj, optionally writing to stream

Method: genome-string [sel] (obj ir) &optional stream

Return the ir code of obj, optionally writing to stream

Method: genome-string [sel] (forth forth) &optional stream

Return genome of forth as a string. Like ‘(genome-string simple)’ but lines are delimited by spaces instead of Newlines.

Method: genome-string [sel] (elf elf) &optional stream

docfixme

Macro: ignore-phenome-errors [sel] &rest body

Handle errors in ‘phenome’ execution by returning nil as the first value from the ‘phenome’ method.

Function: incorporate [sel] software

Incorporate software into population, keeping population size constant.

Generic Function: line-breaks [sel] ir

Return a list with the index of line breaks in ir.

Generic Function: lines [sel] thing &key &allow-other-keys

A list of lines in thing.

Method: lines [sel] (range sw-range) &key

docfixme

Method: lines [sel] (light light) &key

docfixme

Method: lines [sel] (obj clang) &rest args &key

Return a list of lines of source in obj

Method: lines [sel] (obj ir) &rest args &key

Return a list of lines of ir in obj

Method: lines [sel] (elf elf-risc) &key

docfixme

Method: lines [sel] (elf elf-cisc) &key

docfixme

Method: lines [sel] (asm asm-heap) &key

Return the list of text lines of the genome.

Generic Function: mcmc-step [sel] software

Change software in a way amenable to mcmc. Specifically every step should be reversible, and the resulting walk should be ergodic.

Method: mcmc-step [sel] (simple simple)

docfixme

Generic Function: mutation-key [sel] software mutation

Key used to organize mutations in *mutation-stats*.

Method: mutation-key [sel] (obj software) mutation

docfixme

Method: mutation-key [sel] (obj clang) op

Return key used to organize mutations in *mutation-stats* hashtable.

Method: mutation-key [sel] (obj project) op

Return key used to organize mutations in *mutation-stats* hashtable.

Generic Function: mutation-targets [sel] software &key filter stmt-pool

Return a list of target ASTs in software from stmt-pool for mutation, filtering using filter, and throwing a ’no-mutation-targets exception if none are available.

Method: mutation-targets [sel] (obj parseable) &key (filter nil) (stmt-pool (function asts) stmt-pool-supplied-p)

Return a list of target ASTs from stmt-pool for mutation, throwing a ’no-mutation-targets exception if none are available.

Method: mutation-targets [sel] (clang clang) &key (filter nil) (stmt-pool (function stmt-asts))

Return a list of target ASTs from stmt-pool for mutation, throwing a ’no-mutation-targets exception if none are available.

Function: new-individual [sel] &optional a b

Generate a new individual from *population*.

Generic Function: one-point-crossover [sel] software-a software-b

Crossover at a single point.

Method: one-point-crossover [sel] (a sw-range) (b sw-range)

docfixme

Method: one-point-crossover [sel] (a simple) (b simple)

docfixme

Generic Function: phenome [sel] software &key bin build-dir keep-assembly-file

Phenotype of the software. This method will link, compile or serialize the software object as necessary returning an executable version of the software suitable for testing and evaluation. Returns multiple values holding in order; (1) the binary path to which the executable was compiled, (2) the errno, or a numeric indication of success, of the compilation process, (3) stderr of the compilation process, or a string holding error output relevant to phenome generation, (4) stdout of the compilation process, or a string holding non-error output relevant to phenome generation, (5) the source file name used during compilation.

Method: phenome [sel] (obj project) &key (bin (temp-file-name)) (build-dir (or *build-dir* (project-dir obj)))

Build the software project obj and copy build artifact(s) to bin.

Method: phenome [sel] (obj compilable) &key (bin (temp-file-name))

Compile obj to create an executable version of the software on the filesystem at bin.

Method: phenome [sel] (obj super-mutant) &key (bin (temp-file-name))

Phenotype of the software. This method will link, compile or serialize the software object as necessary returning an executable version of the software suitable for testing and evaluation. Returns multiple values holding in order; (1) the binary path to which the executable was compiled, (2) the errno, or a numeric indication of success, of the compilation process, (3) stderr of the compilation process, or a string holding error output relevant to phenome generation, (4) stdout of the compilation process, or a string holding non-error output relevant to phenome generation, (5) the source file name used during compilation.

Method: phenome [sel] (llvm llvm) &key (bin (temp-file-name))

docfixme

Method: phenome [sel] (forth forth) &key (bin (temp-file-name))

Write forth to an executable script suitable for evaluation.

Method: phenome [sel] (elf elf) &key (bin (temp-file-name))

docfixme

Method: phenome [sel] (asm asm-super-mutant) &key (bin (temp-file-name type out)) (keep-assembly-file nil)

Create ASM file, assemble it, and link to create binary bin.

Method: phenome [sel] (asm asm-heap) &key (bin (temp-file-name))

Runs the ‘linker’ for asm-heap, using the specified ‘flags’ for ASM and returns multiple values holding in order: (1) the binary path bin to which the executable was compiled, (2) the errno, or a numeric indication of success, of the linking process, (3) stderr of the linking process, (4) stdout of the linking process, (5) the source file name used during linking.

Method: phenome [sel] (asm asm) &key (bin (temp-file-name))

Runs the ‘linker’ for ASM, using the specified ‘flags’ for ASM and returns multiple values holding in order: (1) the binary path bin to which the executable was compiled, (2) the errno, or a numeric indication of success, of the linking process, (3) stderr of the linking process, (4) stdout of the linking process, (5) the source file name used during linking.

Method: phenome [sel] (obj lisp-project) &key (bin (temp-file-name))

Create a phenotype of the lisp-project. As lisp is not a compiled language do nothing.

Method: phenome [sel] (obj python-project) &key (bin (temp-file-name))

Create a phenotype of the python-project. In this case, as python is not a compiled language, override the phenome method to return where the genome of obj is written to - bin.

obj object to create a phenome for bin location where the phenome will be created on the filesystem

Method: around phenome [sel] (obj javascript-project) &key (bin (temp-file-name))

Bind *build-dir* to bin ensuring the genome of obj in written to bin.

Method: phenome [sel] (obj javascript-project) &key (bin (temp-file-name))

Create a phenotype of the javascript-project. In this case, override the phenome method to return bin where the genome of obj is output. JavaScript is not a compiled language, so we return the genome instead of a binary.

obj object to create a phenome for bin location where the phenome will be created on the filesystem

Condition: phenome [sel]

Class precedence list: phenome, error, serious-condition, condition, slot-object, t

docfixme

Macro: evolve [sel] test &key max-evals max-time period period-fn every-pre-fn every-post-fn filter analyze-mutation-fn super-mutant-count

Evolves ‘*population*’ using ‘new-individual’ and test.

Other keyword arguments are used as defined in the ‘-search’ function.

Generic Function: phenome-p [sel] software

Return non-nil if software has a phenotype.

Generic Function: pick [sel] software key &optional func

Pick an element of genome based on key of each element. key is passed to ‘proportional-pick’ to return an index. Optional argument func processes the index to return a result.

Generic Function: pick-bad [sel] software

Pick a ’bad’ index into a software object. Used to target mutation.

Method: pick-bad [sel] (obj parseable)

Pick a ’bad’ index into a software object. Used to target mutation.

Method: pick-bad [sel] (clang clang)

Pick a random AST in clang from the ‘bad-stmt’ pool.

Method: pick-bad [sel] (elf elf)

docfixme

Method: pick-bad [sel] (obj coq)

Return a randomly selected index of a bad statement in obj. Remove statements containing Coq location info from consideration. If none exist, raise a ‘no-mutation-targets’ error.

Generic Function: pick-bad-bad [sel] software &key filter bad-pool &allow-other-keys

Pick two ’bad’ indexes into a software object. Used to target mutation.

Method: pick-bad-bad [sel] (software parseable) &key filter (bad-pool (function bad-asts))

Pick two ASTs from software, both from the ‘bad-asts’ pool, excluding those ASTs removed by filter.

second should be included as a possible pick * bad-pool function returning a pool of ’bad’ ASTs in software

Method: pick-bad-bad [sel] (clang clang) &key filter (bad-pool (function bad-stmts))

Pick two ASTs from clang, both from the ‘bad-asts’ pool, excluding those ASTs removed by filter.

second should be included as a possible pick * bad-pool function returning a pool of ’bad’ ASTs in software

Generic Function: pick-bad-good [sel] software &key filter bad-pool good-pool &allow-other-keys

Pick a ’bad’ and a ’good’ indexes into a software object. Used to target mutation.

Method: pick-bad-good [sel] (software parseable) &key filter (bad-pool (function bad-asts)) (good-pool (function good-asts))

Pick two ASTs from software, first from ‘bad-pool’ followed by ‘good-pool’, excluding those ASTs removed by filter.

second should be included as a possible pick

Method: pick-bad-good [sel] (clang clang) &key filter (bad-pool (function bad-stmts)) (good-pool (function good-stmts))

Pick two ASTs from clang, both from the ‘bad-asts’ pool, excluding those ASTs removed by filter.

second should be included as a possible pick

Generic Function: pick-bad-only [sel] software &key filter bad-pool &allow-other-keys

Pick a single ’bad’ index into a software object. Used to target mutation.

Method: pick-bad-only [sel] (software parseable) &key filter (bad-pool (function bad-asts))

Pick a single AST from software from ‘bad-pool’, excluding those ASTs removed by filter.

second should be included as a possible pick * bad-pool function returning a pool of ’bad’ ASTs in software

Method: pick-bad-only [sel] (clang clang) &key filter (bad-pool (function bad-stmts))

Pick a single AST from clang from ‘bad-pool’, excluding those ASTs removed by filter.

second should be included as a possible pick * bad-pool function returning a pool of ’bad’ ASTs in software

Generic Function: pick-good [sel] software

Pick a ’good’ index into a software object. Used to target mutation.

Method: pick-good [sel] (obj parseable)

Pick a ’good’ index into a software object. Used to target mutation.

Method: pick-good [sel] (clang clang)

Pick a random AST in clang from the ‘good-stmt’ pool.

Method: pick-good [sel] (elf elf)

docfixme

Method: pick-good [sel] (obj coq)

Return a randomly selected index of a good statement in obj. Remove statements containing Coq location info from consideration. If none exist, raise a ‘no-mutation-targets’ error.

Generic Function: picker [sel] x

Reader for the picker slot of mutation objects

Method: picker [sel] (json-mutation json-mutation)

A function from software -> random target.

Method: picker [sel] (simple-swap simple-swap)

A function from software -> random target.

Method: picker [sel] (simple-insert simple-insert)

A function from software -> random target.

Method: picker [sel] (double-cut double-cut)

A function from software -> random target.

Method: picker [sel] (simple-cut simple-cut)

A function from software -> random target.

Method: picker [sel] (parseable-nop parseable-nop)

A function from software -> random target.

Method: picker [sel] (parseable-cut parseable-cut)

A function from software -> random target.

Method: picker [sel] (parseable-replace parseable-replace)

A function from software -> random target.

Method: picker [sel] (parseable-move parseable-move)

A function from software -> random target.

Method: picker [sel] (parseable-swap parseable-swap)

A function from software -> random target.

Method: picker [sel] (parseable-insert parseable-insert)

A function from software -> random target.

Method: picker [sel] (javascript-mutation javascript-mutation)

A function from software -> random target.

Method: picker [sel] (python-mutation python-mutation)

A function from software -> random target.

Method: picker [sel] (cpp-mutation cpp-mutation)

A function from software -> random target.

Method: picker [sel] (c-mutation c-mutation)

A function from software -> random target.

Method: picker [sel] (expand-arithmatic-op expand-arithmatic-op)

A function from software -> random target.

Method: picker [sel] (rename-variable rename-variable)

A function from software -> random target.

Method: picker [sel] (swap-decls swap-decls)

A function from software -> random target.

Method: picker [sel] (cut-decl cut-decl)

A function from software -> random target.

Method: picker [sel] (coalesce-while-loop coalesce-while-loop)

A function from software -> random target.

Method: picker [sel] (explode-for-loop explode-for-loop)

A function from software -> random target.

Method: picker [sel] (clang-promote-guarded clang-promote-guarded)

A function from software -> random target.

Method: picker [sel] (clang-nop clang-nop)

A function from software -> random target.

Method: picker [sel] (clang-cut-full clang-cut-full)

A function from software -> random target.

Method: picker [sel] (clang-cut clang-cut)

A function from software -> random target.

Method: picker [sel] (clang-replace-full-same clang-replace-full-same)

A function from software -> random target.

Method: picker [sel] (clang-replace-same clang-replace-same)

A function from software -> random target.

Method: picker [sel] (clang-replace-full clang-replace-full)

A function from software -> random target.

Method: picker [sel] (clang-replace clang-replace)

A function from software -> random target.

Method: picker [sel] (clang-move clang-move)

A function from software -> random target.

Method: picker [sel] (clang-swap-full-same clang-swap-full-same)

A function from software -> random target.

Method: picker [sel] (clang-swap-same clang-swap-same)

A function from software -> random target.

Method: picker [sel] (clang-swap-full clang-swap-full)

A function from software -> random target.

Method: picker [sel] (clang-swap clang-swap)

A function from software -> random target.

Method: picker [sel] (clang-insert-full-same clang-insert-full-same)

A function from software -> random target.

Method: picker [sel] (clang-insert-same clang-insert-same)

A function from software -> random target.

Method: picker [sel] (clang-insert-full clang-insert-full)

A function from software -> random target.

Method: picker [sel] (clang-insert clang-insert)

A function from software -> random target.

Method: picker [sel] (sexp-swap sexp-swap)

A function from software -> random target.

Method: picker [sel] (sexp-replace sexp-replace)

A function from software -> random target.

Method: picker [sel] (sexp-cut sexp-cut)

A function from software -> random target.

Method: picker [sel] (random-subtree random-subtree)

A function from software -> random target.

Method: picker [sel] (double-half double-half)

A function from software -> random target.

Method: picker [sel] (subtract-add-tree subtract-add-tree)

A function from software -> random target.

Method: picker [sel] (add-subtract-scope add-subtract-scope)

A function from software -> random target.

Method: picker [sel] (add-subtract-tree add-subtract-tree)

A function from software -> random target.

Method: picker [sel] (subtract-add subtract-add)

A function from software -> random target.

Method: picker [sel] (add-subtract add-subtract)

A function from software -> random target.

Method: picker [sel] (mult-divide mult-divide)

A function from software -> random target.

Method: picker [sel] (demote-binop-right demote-binop-right)

A function from software -> random target.

Method: picker [sel] (demote-binop-left demote-binop-left)

A function from software -> random target.

Method: picker [sel] (change-constant change-constant)

A function from software -> random target.

Method: picker [sel] (change-operator change-operator)

A function from software -> random target.

Method: picker [sel] (type-safe-swap type-safe-swap)

A function from software -> random target.

Method: picker [sel] (replace-fodder-full replace-fodder-full)

A function from software -> random target.

Method: picker [sel] (replace-fodder-same replace-fodder-same)

A function from software -> random target.

Method: picker [sel] (insert-fodder-full insert-fodder-full)

A function from software -> random target.

Method: picker [sel] (insert-fodder insert-fodder)

A function from software -> random target.

Method: picker [sel] (insert-fodder-decl insert-fodder-decl)

A function from software -> random target.

Method: picker [sel] (insert-fodder-decl-rep insert-fodder-decl-rep)

A function from software -> random target.

Method: picker [sel] (asm-replace-operand asm-replace-operand)

A function from software -> random target.

Method: picker [sel] (typescript-typescript-mutation typescript-typescript-mutation)

A function from software -> random target.

Method: picker [sel] (typescript-tsx-mutation typescript-tsx-mutation)

A function from software -> random target.

Method: picker [sel] (rust-mutation rust-mutation)

A function from software -> random target.

Method: picker [sel] (regex-mutation regex-mutation)

A function from software -> random target.

Method: picker [sel] (jsdoc-mutation jsdoc-mutation)

A function from software -> random target.

Method: picker [sel] (java-mutation java-mutation)

A function from software -> random target.

Method: picker [sel] (html-mutation html-mutation)

A function from software -> random target.

Method: picker [sel] (golang-mutation golang-mutation)

A function from software -> random target.

Method: picker [sel] (css-mutation css-mutation)

A function from software -> random target.

Method: picker [sel] (bash-mutation bash-mutation)

A function from software -> random target.

Class: software [sel]

Class precedence list: software, oid-object, standard-object, slot-object, t

Base class for all software objects.

Macro: mcmc [sel] original test &key accept-fn max-evals max-time period period-fn every-pre-fn every-post-fn filter analyze-mutation-fn

mcmc search from original using ‘mcmc-step’ and test. If keyword argument accept-fn is given it is used to determine when a newly found candidate replaces the current candidate. If accept-fn is not supplied mcmc defaults to using Metropolis Hastings.

Other keyword arguments are used as defined in the ‘-search’ function.

Generic Function: mutate [sel] software

Mutate the software. May throw a ‘mutate’ error.

Method: mutate [sel] (obj project)

Randomly pick one file to mutate.

Method: mutate [sel] (obj parseable)

Select a random mutation and mutate obj.

Method: mutate [sel] (clang clang)

Select a random mutation and mutate clang.

Method: mutate [sel] (llvm llvm)

docfixme

Method: mutate [sel] (obj ir)

Apply a mutation to obj

Method: mutate [sel] (elf elf)

Randomly mutate elf.

Macro: sequence-mutations [sel] class-name mut-a mut-b &rest options

Define a new mutation named class-name sequencing mut-a and mut-b. mut-a and mut-b are instances of mutations. Instead of collecting targets for A and then targets for b and then applying A and b as done by ‘compose-mutations’, ‘sequence-mutations’ first targets and applies A and then targets and applied b.

Function: crossed [sel] &optional a b

Generate a new individual from *population* using crossover.

Function: default-random-winner [sel] group &key predicate

Choose a random winner from group.

Function: fitness-better-p [sel] fitness-a fitness-b

Check if fitness-a is strictly better than fitness-b.

Function: mutant [sel] &optional new

Generate a new mutant from a *population*.

Generic Function: pick-mutation-type [sel] software

Select a type of mutation to apply to software.

Method: pick-mutation-type [sel] (obj parseable)

Select type of mutation to apply to obj.

Method: pick-mutation-type [sel] (obj clang)

Select type of mutation to apply to obj.

Method: pick-mutation-type [sel] (obj expression)

docfixme

Method: pick-mutation-type [sel] (obj coq)

Randomly select a mutation that may be performed on obj.

Method: pick-mutation-type [sel] (obj clang-w-fodder)

Select type of mutation to apply to obj.

Method: pick-mutation-type [sel] (asm asm)

Return a symbol naming a randomly selected ASM mutation.

Function: simple-evaluate [sel] test new-children

Evaluate new-children using test assigning each a fitness.

Function: simple-reproduce [sel] population

Reproduce using every individual in population. Return a list of the resulting children and as optional extra value a list of the mutations applied to produce those children.

Function: summarize-mutation-stats [sel]

docfixme * results docfixme

Generic Function: targeter [sel] x

Reader for the targeter slot of mutation objects

Method: targeter [sel] (json-mutation json-mutation)

A function from software -> targets.

Method: targeter [sel] (simple-swap simple-swap)

A function from software -> targets.

Method: targeter [sel] (simple-insert simple-insert)

A function from software -> targets.

Method: targeter [sel] (double-cut double-cut)

A function from software -> targets.

Method: targeter [sel] (simple-cut simple-cut)

A function from software -> targets.

Method: targeter [sel] (parseable-nop parseable-nop)

A function from software -> targets.

Method: targeter [sel] (parseable-cut parseable-cut)

A function from software -> targets.

Method: targeter [sel] (parseable-replace parseable-replace)

A function from software -> targets.

Method: targeter [sel] (parseable-move parseable-move)

A function from software -> targets.

Method: targeter [sel] (parseable-swap parseable-swap)

A function from software -> targets.

Method: targeter [sel] (parseable-insert parseable-insert)

A function from software -> targets.

Method: targeter [sel] (javascript-mutation javascript-mutation)

A function from software -> targets.

Method: targeter [sel] (python-mutation python-mutation)

A function from software -> targets.

Method: targeter [sel] (cpp-mutation cpp-mutation)

A function from software -> targets.

Method: targeter [sel] (c-mutation c-mutation)

A function from software -> targets.

Method: targeter [sel] (expand-arithmatic-op expand-arithmatic-op)

A function from software -> targets.

Method: targeter [sel] (rename-variable rename-variable)

A function from software -> targets.

Method: targeter [sel] (swap-decls swap-decls)

A function from software -> targets.

Method: targeter [sel] (cut-decl cut-decl)

A function from software -> targets.

Method: targeter [sel] (coalesce-while-loop coalesce-while-loop)

A function from software -> targets.

Method: targeter [sel] (explode-for-loop explode-for-loop)

A function from software -> targets.

Method: targeter [sel] (clang-promote-guarded clang-promote-guarded)

A function from software -> targets.

Method: targeter [sel] (clang-nop clang-nop)

A function from software -> targets.

Method: targeter [sel] (clang-cut-full clang-cut-full)

A function from software -> targets.

Method: targeter [sel] (clang-cut clang-cut)

A function from software -> targets.

Method: targeter [sel] (clang-replace-full-same clang-replace-full-same)

A function from software -> targets.

Method: targeter [sel] (clang-replace-same clang-replace-same)

A function from software -> targets.

Method: targeter [sel] (clang-replace-full clang-replace-full)

A function from software -> targets.

Method: targeter [sel] (clang-replace clang-replace)

A function from software -> targets.

Method: targeter [sel] (clang-move clang-move)

A function from software -> targets.

Method: targeter [sel] (clang-swap-full-same clang-swap-full-same)

A function from software -> targets.

Method: targeter [sel] (clang-swap-same clang-swap-same)

A function from software -> targets.

Method: targeter [sel] (clang-swap-full clang-swap-full)

A function from software -> targets.

Method: targeter [sel] (clang-swap clang-swap)

A function from software -> targets.

Method: targeter [sel] (clang-insert-full-same clang-insert-full-same)

A function from software -> targets.

Method: targeter [sel] (clang-insert-same clang-insert-same)

A function from software -> targets.

Method: targeter [sel] (clang-insert-full clang-insert-full)

A function from software -> targets.

Method: targeter [sel] (clang-insert clang-insert)

A function from software -> targets.

Method: targeter [sel] (sexp-swap sexp-swap)

A function from software -> targets.

Method: targeter [sel] (sexp-replace sexp-replace)

A function from software -> targets.

Method: targeter [sel] (sexp-cut sexp-cut)

A function from software -> targets.

Method: targeter [sel] (random-subtree random-subtree)

A function from software -> targets.

Method: targeter [sel] (double-half double-half)

A function from software -> targets.

Method: targeter [sel] (subtract-add-tree subtract-add-tree)

A function from software -> targets.

Method: targeter [sel] (add-subtract-scope add-subtract-scope)

A function from software -> targets.

Method: targeter [sel] (add-subtract-tree add-subtract-tree)

A function from software -> targets.

Method: targeter [sel] (subtract-add subtract-add)

A function from software -> targets.

Method: targeter [sel] (add-subtract add-subtract)

A function from software -> targets.

Method: targeter [sel] (mult-divide mult-divide)

A function from software -> targets.

Method: targeter [sel] (demote-binop-right demote-binop-right)

A function from software -> targets.

Method: targeter [sel] (demote-binop-left demote-binop-left)

A function from software -> targets.

Method: targeter [sel] (change-constant change-constant)

A function from software -> targets.

Method: targeter [sel] (change-operator change-operator)

A function from software -> targets.

Method: targeter [sel] (type-safe-swap type-safe-swap)

A function from software -> targets.

Method: targeter [sel] (replace-fodder-full replace-fodder-full)

A function from software -> targets.

Method: targeter [sel] (replace-fodder-same replace-fodder-same)

A function from software -> targets.

Method: targeter [sel] (insert-fodder-full insert-fodder-full)

A function from software -> targets.

Method: targeter [sel] (insert-fodder insert-fodder)

A function from software -> targets.

Method: targeter [sel] (insert-fodder-decl insert-fodder-decl)

A function from software -> targets.

Method: targeter [sel] (insert-fodder-decl-rep insert-fodder-decl-rep)

A function from software -> targets.

Method: targeter [sel] (asm-replace-operand asm-replace-operand)

A function from software -> targets.

Method: targeter [sel] (typescript-typescript-mutation typescript-typescript-mutation)

A function from software -> targets.

Method: targeter [sel] (typescript-tsx-mutation typescript-tsx-mutation)

A function from software -> targets.

Method: targeter [sel] (rust-mutation rust-mutation)

A function from software -> targets.

Method: targeter [sel] (regex-mutation regex-mutation)

A function from software -> targets.

Method: targeter [sel] (jsdoc-mutation jsdoc-mutation)

A function from software -> targets.

Method: targeter [sel] (java-mutation java-mutation)

A function from software -> targets.

Method: targeter [sel] (html-mutation html-mutation)

A function from software -> targets.

Method: targeter [sel] (golang-mutation golang-mutation)

A function from software -> targets.

Method: targeter [sel] (css-mutation css-mutation)

A function from software -> targets.

Method: targeter [sel] (bash-mutation bash-mutation)

A function from software -> targets.

Generic Function: targets [sel] mutation

Return all possible targets of mutation.

Generic Function: to-file [sel] software file

Write software to file.

Method: after to-file [sel] (obj file-w-attributes) path

Wrapper around the ‘to-file‘ method to preserve permissions and modification time when writing obj to path.

Method: to-file [sel] (obj coq) path

Look up source strings for Coq obj ASTs and write to path.

Method: before to-file [sel] (asm asm-heap) file

Save the assembly for ASM to file. If any rip-relative addresses have been converted to absolute, for evaluation, restore them to the original instructions.

Method: to-file [sel] (asm asm-heap) file

Save the assembly for ASM to file.

Function: tournament [sel] &key predicate tie-breaker-predicate size

Select an individual from *population* with a tournament.

Generic Function: two-point-crossover [sel] software-a software-b

Crossover between two points.

Method: two-point-crossover [sel] (a sw-range) (b sw-range)

docfixme

Method: two-point-crossover [sel] (a simple) (b simple)

docfixme


Next: , Previous: , Up: Software Evolution Library Index   [Contents][Index]