Git Product home page Git Product logo

bonsai's Introduction

bonsai

Companion guide (PPDP19) (see below if the link is dead).

Spacetime programming is a programming language on top of Java to describe search strategies exploring combinatorial state-space such as in constraint satisfaction problems. Please consult the spacetime manual for more information.

Build the manual

You might want to build the manual from the repository because you need it to be synchronized with a specific version of Bonsai or simply for offline usage. Download the utility mdbook:

cargo install mdbook

Once installed, go inside bonsai/doc and execute mdbook build -o. The manual is generated inside a local folder named book and is directly opened in your browser.

bonsai's People

Contributors

ptal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bonsai's Issues

Method call on `this` in the context of causality analysis

A problem occurs with method calls such as this.m() since m has accessed to every field of this (see #2).
To allow non-static methods in a spacetime module, we can etiher:

  1. Analyse the Java method to check for read and write accesses (seems very complex since we must parse and understand the full Java syntax).
  2. Annotate the call on this with the permissions of the variables accessed.
  3. Allow possible causality holes when calling external functions (i.e. Java methods).

Forbid two bonsai classes with the same name

If we accept classes with same name (but in different package), we need a package resolution mechanism that look up into the import list.
It is not easy with little benefit for now so the solution is to forbid bonsai class to have an identical name.

Forbid non-static method in spacetime module

Problem: Calling a method this.m() means that m has accessed to every field of this and we cannot control which ones are accessed and how.

Solution: Add a static analysis to prevent non-static method in spacetime modules.

See also #3.

Resolution of Java object attributes panics

  public proc bug() =
    single_space LMax depth = 2;
    System.out.println(depth.value);
  end

with assert:

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `Spacetime(SingleSpace)`,
 right: `Host`: depth', src/middle/resolve.rs:76:9

NOTE: the code above is not right anyway since value is private in LMax. However it should be triggered at the Java compilation stage, not at the Bonsai compilation stage.

Explaining causality errors by incremental solving

The compiler just reports that a causality analysis occurred without giving information on the variables that generate this error.
This is a well-known weakness of constraint programming: it is hard to debug (or in this case explain) unsatisfiable instances.
There exists however a bunch of techniques, references and techniques can be found in Chapter 6 of "Making the Most of Structure in Constraint Models", Kevin Leo, 2018.
We could also take advantage of the iterative structure of our problem by testing the satisfiability each time we add a constraint into the model.

Forbid write and readwrite on pre variable

For example: pre x.inc() should not be valid because the method inc modifies the variable x.

We chose to specify read/write attributes on the variables because we did not want to impact the Java signature of a method (that might not be inside the current project) or add wrappers around these methods to specify these attributes.
However this static analysis would be more easily done if we have read/write attributes on the methods themselves.
Another possibility is to force the user to write pre read x.inc() although with pre it is already implied.
(Note that it does not solve the problem that the user can lie about the Java signature...).

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.