8000 GitHub - vhui/PyExSMT: Python Symbolic Execution
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

vhui/PyExSMT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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))

About

Python Symbolic Execution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
0