Giter VIP home page Giter VIP logo

pyexsmt's Introduction

PyExSMT

Python Exploration with PySMT

This code is a substantial rewrite of the PyExZ3 (https://github.com/thomasjball/PyExZ3) symbolic execution engine for Python, now using the PySMT project (https://github.com/pysmt/pysmt).

Installing

# Install this fork of PySMT
git clone https://github.com/FedericoAureliano/pysmt.git
cd pysmt
sudo python3 setup.py install
cd ..

# Install PyExSMT
git clone https://github.com/FedericoAureliano/PyExSMT.git
cd PyExSMT
sudo python3 setup.py install

# To display graphs
sudo apt install graphviz

Usage

usage: pyexsmt [-h] [--log LOGLEVEL] [--uninterp name return_type arg_types]
        [--entry ENTRY] [--graph] [--summary] [--max-iters MAX_ITERS]
        [--max-depth MAX_DEPTH] [--solver SOLVER]
        file

Example

def lib(x,y):
    if x == 0:
        return 0
    else:
        return x + y
    return 10

def demo(in1, in2, in3):
    if lib(in1, in2) > 0:
        return 0
    else:
        return lib(in2, in3)

Graph Generation

pyexsmt --graph demo.py

demo graph

pyexsmt --graph --uninterp lib int [int,int] demo.py

demo graph

pyexsmt --graph --entry lib demo.py

demo graph

Summary Generation

pyexsmt --summary demo.py

Summary:
((in1 = 0) ? ((in2 = 0) ? 0 : (in2 + in3)) : ((0 < (in1 + in2)) ? 0 : ((in2 = 0) ? 0 : (in2 + in3))))
pyexsmt --summary --uninterp lib int [int,int] demo.py

Summary:
((0 < lib(in1, in2)) ? 0 : lib(in2, in3))
pyexsmt --summary --entry lib demo.py

Summary:
((x = 0) ? 0 : (x + y))

pyexsmt's People

Contributors

federicoaureliano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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