Giter Club home page Giter Club logo

pydrogen's Introduction

pydrogen
========

Python library for building embedded languages within Python that have alternative operational semantics or abstract interpretations.

Purpose
-------
This library allows programmers to free the building blocks that constitute Python syntax from the default Python semantics. It is designed to allow programmers to define quickly and to use immediately one or more alternative abstract interpretation or operational semantics for Python.

Web:           pydrogen.org
Version:       0.0.2.0
Compatibility: Python 3
Dependencies:  ast, inspect

Package Installation and Usage
------------------------------

The package is available on PyPI:

    pip install pydrogen

The library can be imported in the usual way:

    import pydrogen
    
Some usage examples can be found at http://pydrogen.org.

pydrogen's People

Contributors

lapets avatar timql avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pydrogen's Issues

Some test cases and improvements

Create a few working examples demonstrating how the library can be used to predict running times for a small subset of Python programs, including:

  • explicit (i.e., numeric) prediction of steps the number of steps;
  • symbolic prediction (i.e., as a polynomial) for functions that take a list of integers.

Identify any issues that arise from the use of the library (and add tickets as necessary).

module 'pydrogen' has no attribute 'Pydrogen'?

Hi,

Has anyone met this error before?
When I used the sample code in document, AttributeError occurs.
AttributeError: module 'pydrogen' has no attribute 'Pydrogen'

The codes are:
import pydrogen
class Ty(pydrogen.Pydrogen):
def Statements(self, ss): return ss.post()[-1] # Last statement.
def Module(self, ss): return ss.post()
def FunctionDef(self, ss): return ss.post()
def Return(self, e): return e.post()

def True_(self): return 'Bool'
def False_(self): return 'Bool'
def BoolOp(self, es): return 'Bool'if frozenset(es.post()) == {'Bool'} else 'Error'
def Not(self, e): return 'Bool' if e.post() == 'Bool' else 'Error'

def Num(self, n): return 'Int'
def Add(self, e1, e2): return 'Int' if e1.post() == 'Int' and e2.post() == 'Int' else 'Error'
def Sub(self, e1, e2): return 'Int' if e1.post() == 'Int' and e2.post() == 'Int' else 'Error'
def Mult(self, e1, e2): return 'Int' if e1.post() == 'Int' and e2.post() == 'Int' else 'Error'
def USub(self, e): return 'Int' if e.post() == 'Int' else 'Error'

Thank you very much! Looking forward to the solution!

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.