GithubHelp home page GithubHelp logo

crowbar-tool's Introduction

Crowbar

Crowbar is a symbolic execution engine for ABS, based on BPL. Crowbar aims to provide a possibility to prototype novel deductive verification techniques for functional correctness of Active Objects. Contrary to KeY, which it aims to complement for ABS, and full interactive provers, Crowbar does not include a reasoning system. Instead, symbolic execution generates a set of first-order formulas that are passed to a backend solver in the SMT-LIB format (Test are checking with Z3 and CVC4).

Crowbar is at a very early development stage.

Example

Clone the code, generate an executable jar with ./gradlew shadowJar, save the following ABS code and call java -jar ./build/libs/crowbar-0.1-all.jar --class="Test.C" <file>

module Test;

data Spec = ObjInv(Bool)        //Object Invariants
          | Ensures(Bool)       //Pre-conditions of method and classes
          | Requires(Bool)      //Post-conditions
          | WhileInv(Bool);     //Loop invariants

[Spec : Requires(n > 0)]
[Spec : Ensures(result > 0)]
def Int fac(Int n) = if(n == 1) then 1 else n*fac(n-1);

interface I{
    [Spec : Ensures(result >= 0)]
    Int m(Int v);
}

[Spec : Requires(this.init > 0)]
[Spec : ObjInv(this.f > 0 && this.init > 0)]
class C(Int init) implements I {
    Int f = init;

    Int m(Int v){
        Int w = v;
        if(w > 0)  this.f = fac(w);
        else       this.f = fac(-w+init);
        return v*w;
    }
}

{
    I i = new C(10);
    i!m(fac(5));
}

Misc.

  • Method preconditions are split into parameter preconditions in the interface and heap preconditions in the class.

    If you call a method asynchronously on this and you want to use parameter preconditions, it must be exposed. The heap precondition propagation is not implemented, you have to ensure that yourself.

    Right now, the restrictions on pre- and postconditions in general are not checked

  • Please make sure that some SMT solver is installed and callable via command line. The tests use the z3 and cvc commands.

  • Crowbar does not yet support any SPL option.

  • Name clashes with internal expressions are not checked yet

crowbar-tool's People

Contributors

derdrodt avatar edkamb avatar marcoscaletta avatar rec0de 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.