GithubHelp home page GithubHelp logo

janvrany / machinearithmetic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shingarov/machinearithmetic

0.0 2.0 0.0 1.81 MB

License: MIT License

Smalltalk 97.04% StringTemplate 1.64% Python 1.16% Makefile 0.17%

machinearithmetic's Introduction

A mathematical foundation for Smalltalk-25

Originally when this repo was first created, we had in mind a much more modest / narrow scope: back then we simply wanted a model of finite-precision machine integers which would be more suitable for the superoptimizing Smalltalk JIT we were building, than the elaborate model of ℤ (the hierarchy of Integer) which we as Smalltalkers are rightly proud of.

However, as work on the superoptimizer advanced, it became progressively more obvious that the conceptual gap between the functionality consumed by the modern program analysis algorithms, and the pointwise-calculational term reducers provided by any existing Smalltalk-80 host, is hopelessly too wide to bridge in an ad-hoc fashion.

MachineArithmetic addresses this problem systematically. We begin by bringing in some rudimentary combinatorics, starting from an FFI to the Z3 SMT solver, and a crude first approximation to a graph search. Over that foundation we implement a minimalistic equational prover, mostly following Cosman–Jhala ICFP'17 and Vazou et al. POPL'18 and consulting Liquid Fixpoint as a reference implementation of the algorithm.

How to load

...into Pharo or GT

Metacello new
  baseline: 'MachineArithmetic';
  repository: 'github://shingarov/MachineArithmetic:pure-z3';
  load.

To create fresh image for development

Either use shortcut:

git clone https://github.com/shingarov/MachineArithmetic
cd MachineArithmetic/pharo
make
./pharo MachineArithmetic.image

...or do it by hand:

  1. Clone the repository

    git clone https://github.com/shingarov/MachineArithmetic
    
  2. Download Pharo

    # Be carefull, running a script downloaded from internet is not advisable!
    curl https://get.pharo.org/64/80+vm | bash
    
  3. Load code into Pharo image:

    ./pharo Pharo.image save MachineArithmetic
    ./pharo MachineArithmetic.image metacello install tonel://./MachineArithmetic/src BaselineOfMachineArithmetic
    ./pharo MachineArithmetic.image eval --save "(IceRepositoryCreator new location: 'MachineArithmetic' asFileReference; createRepository) register"
    

...into Smalltalk/X

NOTE: The following instructions assume you have a recent Smalltalk/X jv-branch, i.e., a version newer than 2021-12-09 (older versions might not have required Pharo compatibility support — Tonel, PackageManifests, ... — built in).

NOTE: Following instructions load only core MachineArithmetic package (basically Z3 bindings) as the rest is not supported on Smalltalk/X at the moment.

Either use shortcut:

git clone https://github.com/shingarov/MachineArithmetic
cd MachineArithmetic/stx
make
make run

...or do it by hand:

  1. Clone the repository:

    git clone https://github.com/shingarov/MachineArithmetic.git
    
  2. In Smalltalk/X, execute:

    "/ Tell Smalltalk/X where to look for MachineArithmetic packages
    Smalltalk packagePath add: '/where/you/cloned/it/MachineArithmetic'.
    
    "/ Load MachineArithmetic
    Smalltalk loadPackage: 'BaselineOfMachineArithmetic'.
    

How to load Z3 interface only

See MachineArithmetic/README.md

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.