Coder Social home page Coder Social logo

functionalprogramgenerator's Introduction

Functional Program Generation using Genetic Programming

Developed for the AI in Software Engineering course for my MSc. course.

Features so far:

  • parse LISP expressions (operators, conditions, comparisons, null, functions)
  • evaluate LISP expression
  • defun token + recursive functions
  • identify all tokens to use as elements for reproduction in genes
  • check validity of S-expression (using "parse_sexp" or pre-existing compiler "SBCL")
  • use an existing lisp compiler to ensure program correctness and output (difficult to implement everything)
  • considered a different chromosome representation: s-expressions
  • mutation techniques: shrink, subtree, swap
  • inserted perfect candidate in initial pool and see what happens
  • cache fitness computations for candidates without changes - use unique candidate ids
  • improved mutation fairness
  • add similarity coefficient computation in fitness function (ex: https://www.mdpi.com/2076-3417/11/10/4673)
    • caching won't work this way, cause the fitness of an individual is dependent on all other individuals now

Notes:

  • "Null" checks whether a list is empty or not.
  • consider idea: take some existing LISP code, evaluate it, scan it, then generate it.
  • SBCL command for factorial program sbcl --noinform --eval "(defun factorial (n) (cond ((zerop n) 1) (t (* n (factorial (- n 1))))))" --eval "(print (factorial 3))" --quit --disable-debugger

functionalprogramgenerator's People

Contributors

perlmonker303 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.