Giter Site home page Giter Site logo

kleecket's Introduction

kleecket

Or Racklee

Description

Symbolic execution for a mini language.

We use functional data structures, allowing objects in different paths to be shared, avoiding the duplication cost.

Unlike mini-mc, we implement a scheduler, which follows the BFS order. This can be customized easily by replacing the queue data structure with a priority queue.

Language Features

Our language is Turing complete, as it contains lambda calculus. We also add more features so that programming in imperative style is possible.

Core Features

  • Integer, boolean, string, void, and unchecked integer operations
  • Pair, null, and their operations
  • Symbolic values (only integer and boolean)
  • Lambda functions (of one argument)
  • Variable mutation
  • Exception raising
  • Print

Syntactic Sugar

  • Boolean operations
  • When, let, letrec, sequencing, and while loop
  • Assertion
  • Checked integer operations (division specifically)

Unsupported Features (for now)

  • Garbage collection: as of now, we do not implement garbage collection for the sake of simplicity.
  • Multithreading: this in fact should be achievable easily via Racket's thread support. However, the output will be difficult to read, so we don't implement it.

Installation

First, install the latest version of Racket. Then, install Rosette, either via raco or DrRacket's package manager.

How to run

Either execute racket showcase.rkt or open showcase.rkt with DrRacket and run it.

Notes

  • We use Rosette simply as an interface to SMT solver. We don't employ any symbolic evaluation capabilities from Rosette.
  • We interpret the program instead of embedding symbolic execution because we would like to have a complete control over the program state. Rosette workarounds this by a combination of program transformation and state rollbacks, which seems more complicated than just directly interpret the syntax.
  • The usage of shift+reset can be avoided if we interpret in continuation-passing style (CPS).

Grammar

E := (void) | <string> | <integer> | #t | #f
   | (symbolic S T) | (symbolic* T)
   | (assert E)
   | (if E E E)
   | (E E)
   | (set! S E) 
   | (lambda (S) E)
   | (displayln e)
   | (/ E E) | (* E E) | (+ E E) | (- E E)
   | (= E E) | (> E E) | (< E E) | (<= E E) | (>= E E)
   | (null) | (cons E E) | (car E) | (cdr E) | (null? E) | (cons? E)
   | (not E) | (and E E) | (or E E) 
   | (when E E) | (let ([S E]) E) | (begin E E ...)
   | (letrec ([S E]) E) | (while E E)
S := symbol
T := int | bool

Contributors

  • Jacob Van Geffen
  • Kevin Zhao
  • Sorawee Porncharoenwase

kleecket's People

Contributors

sorawee avatar jacobvangeffen avatar

Watchers

James Cloos avatar  avatar  avatar Kevin Zhao avatar  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.