Skip to main content

Implementation of MWP analysis on C code in Python

Project description

pymwp: MWP analysis in Python

build codecov PyPI - Python Version PyPI

pymwp is a tool for automatically performing static analysis on programs written in C. It analyzes resource usage and determines if a program stays within polynomial bounds. See this page for a list of C language features that are currently supported by pymwp.


Documentation and Demo

seiller.github.io/pymwp


Installation

Install latest release from PyPI

pip install pymwp

How to Use

To analyze a C file, run:

pymwp path/to_some_file.c

For all available options and help, run:

pymwp

You can also use pymwp in a Python script:

from pymwp import Polynomial
from pymwp.matrix import identity_matrix, show

matrix = identity_matrix(3)
matrix[0][1] = Polynomial('m')
matrix[1][0] = Polynomial('w')
matrix[2][1] = Polynomial('p')

show(matrix)

See documentation for available modules and methods.

Running from source

If you want to use the latest stable version (possibly ahead of latest release), use the version from source following these steps.

  1. Clone the repository

    git clone https://github.com/seiller/pymwp.git
    
  2. Set up Python environment

    install required packages

    pip install -q -r requirements.txt
    
  3. Run the analysis

    From project root run:

    python -m pymwp path/to_some_file.c
    

    for example:

    python -m pymwp c_files/basics/if.c
    

    for all available options and help, run:

    python -m pymwp
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pymwp-0.0.1-py3-none-any.whl (32.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page