Git Product home page Git Product logo

bachelor-thesis's Introduction

SMT-based Static Type Inference for Python 3

Bachelor Thesis

Author: Mostafa Abdullah

Supervisors:

  • Dr. Caterina Urban
  • Marco Eilers
  • Prof. Peter Müller

Abstract

Static types are useful in many programming languages. They can contribute to the type safety of the language by catching type errors in an early stage and contribute to the documentation of the programs written in it. Python is a dynamically typed language in which types are assigned to variables at runtime. Python is very popular nowadays and is used in different fields especially data science. This justifies the increasing attention towards performing static analysis for Python programs. The aim of this thesis is to provide a static type inference for Python 3. We make use of SMT solving to perform the type inference by encoding the type system of the language in an SMT problem, collecting constraints from the given program and using Z3 SMT solver to provide a types model. We do whole program type inference such that the types model given by the SMT solution includes the types for all the variables that appear in the whole program. We present a static type system for Python which is essential for defining the static type inference rules. We provide an encoding for this type system in the SMT solver Z3 and present a complete implementation of the type inference algorithm based on this encoding. The type inference currently supports many complicated features in Python like multiple inheritance and operator overloading. The proposed type inference is sound, but there remains some Python features which we do not support. The type inference proved to perform well on several programs and an open source project which uses different Python features.

Based on TUM thesis latex template

bachelor-thesis's People

Contributors

mostafa-abdullah avatar

Watchers

 avatar

bachelor-thesis's Issues

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.