Permalink
Browse files

[Architecture][Refactor] Change the name ChocoCubes to runtime becaus…

…e it is more precise.
  • Loading branch information...
ptal committed Jan 3, 2017
1 parent 750329a commit 04fc8bf77c59445735d72166cfc1e3f9299f9ff1
Showing with 105 additions and 134 deletions.
  1. +0 −4 ChocoCubes/install.sh
  2. +5 −36 README.md
  3. +1 −1 benchmark/pom.xml
  4. +3 −3 benchmark/src/main/java/benchmark/bonsai/GolombRuler.bonsai.java
  5. +3 −3 benchmark/src/main/java/benchmark/bonsai/LatinSquare.bonsai.java
  6. +3 −3 benchmark/src/main/java/benchmark/bonsai/NQueens.bonsai.java
  7. +4 −4 examples/bonsai/NQueens/pom.xml
  8. +2 −1 examples/bonsai/NQueens/run.sh
  9. +4 −4 examples/bonsai/NQueens/src/main/java/{chococubes/example → bonsai/examples}/NQueens.bonsai.java
  10. 0 libstd/install.sh
  11. +1 −1 libstd/pom.xml
  12. +3 −3 libstd/src/main/java/bonsai/cp/core/Branching.bonsai.java
  13. +3 −3 libstd/src/main/java/bonsai/cp/core/OneSolution.bonsai.java
  14. +3 −3 libstd/src/main/java/bonsai/cp/core/Propagation.bonsai.java
  15. +5 −5 manual-installation.md
  16. +4 −0 runtime/install.sh
  17. +1 −1 {ChocoCubes → runtime}/pom.xml
  18. +1 −1 ...bes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/choco/Consistent.java
  19. +2 −2 ...rc/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/choco/ConstraintStore.java
  20. +1 −1 ...ubes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/choco/IntDomain.java
  21. +1 −1 ...c/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/choco/PropagatorEngine.java
  22. +3 −3 ...Cubes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/choco/VarStore.java
  23. +1 −1 ...rc/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/core/EntailmentResult.java
  24. +1 −1 ...bes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/core/FlatLattice.java
  25. +1 −1 ...ubes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/core/LatticeVar.java
  26. +1 −1 ...es/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/core/RFlatLattice.java
  27. +1 −1 ...oCubes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/core/RInteger.java
  28. +1 −1 ...ubes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/core/Restorable.java
  29. +1 −1 ...Cubes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/core/Spacetime.java
  30. +1 −1 {ChocoCubes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/core/Store.java
  31. +1 −1 ...c/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/ClosureAtom.java
  32. +2 −2 ...n/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/EntailmentConfig.java
  33. +2 −2 ...rc/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/Executable.java
  34. +2 −2 ...c/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/LocationVar.java
  35. +2 −2 ...src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/RunModule.java
  36. +2 −2 .../src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/Snapshot.java
  37. +2 −2 ...bes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/Space.java
  38. +2 −2 ...c/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/SpaceBranch.java
  39. +2 −2 ...n/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/SpaceEnvironment.java
  40. +2 −2 .../main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/SpaceMachine.java
  41. +2 −2 .../main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/SpacetimeVar.java
  42. +2 −2 ...ubes/src/main/java/bonsai/chococubes → runtime/src/main/java/bonsai/runtime}/sugarcubes/Tell.java
  43. +4 −4 {ChocoCubes → runtime}/test/java/bonsai/chococubes/NQueens.java
  44. +11 −11 setup.py
  45. +1 −1 src/back/generator.rs
  46. +1 −1 src/back/mod.rs
  47. +1 −1 src/driver/mod.rs
  48. +3 −2 update.sh
View

This file was deleted.

Oops, something went wrong.
View
@@ -8,7 +8,7 @@
Bonsai is a programming language on top of Java inspired by synchronous programming and aims at be used to solve Constraint Satisfaction Problems (CSP). The project is decomposed into two parts:
* *Bonsai* is the compiler of the Java extension and is written in Rust.
* *ChocoCubes* is the Java runtime used by the code compiled by bonsai.
* *Bonsai runtime* is the Java runtime used by the code compiled by bonsai.
# Getting Started
@@ -21,7 +21,7 @@ Bonsai is a programming language on top of Java inspired by synchronous programm
## Installation
You need to install both the compiler and the ChocoCubes runtime.
You need to install both the compiler and the runtime using the `setup.py` script.
```sh
git clone https://github.com/ptal/bonsai.git
@@ -55,43 +55,12 @@ Remove the following export line in your profile:
# Example
The following command will compile and execute the NQueens problem as described in the file [NQueens.bonsai.java](examples/bonsai/NQueens/src/main/java/chococubes/example/NQueens.bonsai.java):
The following command will compile and execute the NQueens problem as described in the file [NQueens.bonsai.java](examples/bonsai/NQueens/src/main/java/bonsai/example/NQueens.bonsai.java):
```sh
cd examples/bonsai/NQueens
mvn compile
mvn exec:java -Dexec.mainClass="chococubes.example.NQueens"
mvn exec:java -Dexec.mainClass="bonsai.examples.NQueens"
```
Copy this project and create as much bonsai file (`.bonsai.java`) as you want. For each file created add an `execution` section in your `pom.xml`:
```xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>SomeFile.bonsai.java</id>
...
</execution>
<!-- Add an execution section as follow: -->
<execution>
<id>NQueens.bonsai.java</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bonsai</executable>
<arguments>
<argument>--main</argument>
<argument>-o ${project.build.directory}/generated-sources/bonsai/NQueens.java</argument>
<argument>${project.build.sourceDirectory}/chococubes/example/NQueens.bonsai.java</argument>
</arguments>
</configuration>
</execution>
</executions>
```
Do not forget to modify the `<id>` and the names of the files in the `<argument>`.
Copy this project and create as much bonsai file (`.bonsai.java`) as you want. Do not forget to modify the `<id>` and the names of the files in the `<argument>`. Also, note that it includes the Bonsai standard library (in `/libstd`), you can modify its path in `<argument>--lib=...</argument>`.
View
@@ -31,7 +31,7 @@
</dependency>
<dependency>
<groupId>bonsai</groupId>
<artifactId>ChocoCubes</artifactId>
<artifactId>runtime</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
@@ -8,9 +8,9 @@
import org.chocosolver.solver.constraints.nary.alldifferent.*;
import org.chocosolver.solver.search.strategy.selectors.variables.*;
import org.chocosolver.solver.search.strategy.selectors.values.*;
import bonsai.chococubes.core.*;
import bonsai.chococubes.choco.*;
import bonsai.chococubes.sugarcubes.*;
import bonsai.runtime.core.*;
import bonsai.runtime.choco.*;
import bonsai.runtime.sugarcubes.*;
public class GolombRuler implements Executable
{
@@ -8,9 +8,9 @@
import org.chocosolver.solver.constraints.nary.alldifferent.*;
import org.chocosolver.solver.search.strategy.selectors.variables.*;
import org.chocosolver.solver.search.strategy.selectors.values.*;
import bonsai.chococubes.core.*;
import bonsai.chococubes.choco.*;
import bonsai.chococubes.sugarcubes.*;
import bonsai.runtime.core.*;
import bonsai.runtime.choco.*;
import bonsai.runtime.sugarcubes.*;
public class LatinSquare implements Executable
{
@@ -7,9 +7,9 @@
import org.chocosolver.solver.constraints.nary.alldifferent.*;
import org.chocosolver.solver.search.strategy.selectors.variables.*;
import org.chocosolver.solver.search.strategy.selectors.values.*;
import bonsai.chococubes.core.*;
import bonsai.chococubes.choco.*;
import bonsai.chococubes.sugarcubes.*;
import bonsai.runtime.core.*;
import bonsai.runtime.choco.*;
import bonsai.runtime.sugarcubes.*;
public class NQueens implements Executable
{
@@ -1,8 +1,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>chococubes.example</groupId>
<artifactId>NQueens</artifactId>
<groupId>bonsai</groupId>
<artifactId>examples</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>NQueens</name>
@@ -31,7 +31,7 @@
</dependency>
<dependency>
<groupId>bonsai</groupId>
<artifactId>ChocoCubes</artifactId>
<artifactId>runtime</artifactId>
<version>1.0</version>
</dependency>
<dependency>
@@ -71,7 +71,7 @@
<argument>--main=NQueens</argument>
<argument>--lib=../../../libstd/src/</argument>
<argument>-o ${project.build.directory}/generated-sources</argument>
<argument>${project.build.sourceDirectory}/chococubes</argument>
<argument>${project.build.sourceDirectory}</argument>
</arguments>
</configuration>
</execution>
@@ -1,4 +1,5 @@
#!/bin/sh
mvn clean
mvn compile
mvn exec:java -Dexec.mainClass="chococubes.example.NQueens"
mvn exec:java -Dexec.mainClass="bonsai.examples.NQueens"
@@ -1,4 +1,4 @@
package chococubes.example;
package bonsai.examples;
import java.util.*;
import inria.meije.rc.sugarcubes.*;
@@ -7,9 +7,9 @@
import org.chocosolver.solver.constraints.nary.alldifferent.*;
import org.chocosolver.solver.search.strategy.selectors.variables.*;
import org.chocosolver.solver.search.strategy.selectors.values.*;
import bonsai.chococubes.core.*;
import bonsai.chococubes.choco.*;
import bonsai.chococubes.sugarcubes.*;
import bonsai.runtime.core.*;
import bonsai.runtime.choco.*;
import bonsai.runtime.sugarcubes.*;
import bonsai.cp.core.*;
public class NQueens implements Executable
View
0 libstd/install.sh 100644 → 100755
No changes.
View
@@ -31,7 +31,7 @@
</dependency>
<dependency>
<groupId>bonsai</groupId>
<artifactId>ChocoCubes</artifactId>
<artifactId>runtime</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
@@ -7,9 +7,9 @@
import org.chocosolver.solver.variables.*;
import org.chocosolver.solver.search.strategy.selectors.variables.*;
import org.chocosolver.solver.search.strategy.selectors.values.*;
import bonsai.chococubes.core.*;
import bonsai.chococubes.choco.*;
import bonsai.chococubes.sugarcubes.*;
import bonsai.runtime.core.*;
import bonsai.runtime.choco.*;
import bonsai.runtime.sugarcubes.*;
public class Branching implements Executable
{
@@ -3,9 +3,9 @@
import java.util.*;
import inria.meije.rc.sugarcubes.*;
import inria.meije.rc.sugarcubes.implementation.*;
import bonsai.chococubes.core.*;
import bonsai.chococubes.choco.*;
import bonsai.chococubes.sugarcubes.*;
import bonsai.runtime.core.*;
import bonsai.runtime.choco.*;
import bonsai.runtime.sugarcubes.*;
public class OneSolution implements Executable
{
@@ -3,9 +3,9 @@
import java.util.*;
import inria.meije.rc.sugarcubes.*;
import inria.meije.rc.sugarcubes.implementation.*;
import bonsai.chococubes.core.*;
import bonsai.chococubes.choco.*;
import bonsai.chococubes.sugarcubes.*;
import bonsai.runtime.core.*;
import bonsai.runtime.choco.*;
import bonsai.runtime.sugarcubes.*;
public class Propagation implements Executable
{
View
@@ -1,6 +1,6 @@
# Manual installation procedure
Step-by-step installation of the bonsai compiler and its runtime ChocoCubes. Before attempting the manual installation, you should try the `setup.py` script as described in [README.md](README.md).
Step-by-step installation of the bonsai compiler and its runtime. Before attempting the manual installation, you should try the `setup.py` script as described in [README.md](README.md).
## Prerequisites
@@ -39,17 +39,17 @@ cd libstd # (inside the bonsai repository)
./install.sh
```
## Installing the ChocoCubes runtime
## Installing the Bonsai runtime
The ChocoCubes runtime has two dependencies: [SugarCubes](http://jeanferdysusini.free.fr/index.php?action=SC) for synchronous and reactive programming and [Choco](http://www.choco-solver.org) for constraint programming.
The Bonsai runtime has two dependencies: [SugarCubes](http://jeanferdysusini.free.fr/index.php?action=SC) for synchronous and reactive programming and [Choco](http://www.choco-solver.org) for constraint programming.
1. Installing SugarCubes in the local Maven database:
```sh
curl http://jeanferdysusini.free.fr/v4.0/SugarCubesv4.0.0a5.jar > /tmp/SugarCubesv4.0.0a5.jar
mvn install:install-file -DgroupId=inria.meije.rc -DartifactId=SugarCubes -Dversion=4.0.0a5 -Dpackaging=jar -Dfile=/tmp/SugarCubesv4.0.0a5.jar
```
2. Installing ChocoCubes in the local Maven database:
2. Installing Bonsai runtime in the local Maven database:
```sh
cd ChocoCubes/ # (inside the bonsai repository)
cd runtime/ # (inside the bonsai repository)
./install.sh
```
View
@@ -0,0 +1,4 @@
#!/bin/sh
mvn package
mvn install:install-file -DgroupId=bonsai -DartifactId=runtime -Dversion=1.0 -Dpackaging=jar -Dfile=target/runtime-1.0-SNAPSHOT.jar
@@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>bonsai</groupId>
<artifactId>ChocoCubes</artifactId>
<artifactId>runtime</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.choco;
package bonsai.runtime.choco;
// Lattice represented by this class is:
// Top
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.choco;
package bonsai.runtime.choco;
import java.util.*;
import bonsai.chococubes.core.*;
import bonsai.runtime.core.*;
import org.chocosolver.solver.expression.discrete.relational.*;
import org.chocosolver.solver.constraints.*;
import org.chocosolver.solver.exception.ContradictionException;
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.choco;
package bonsai.runtime.choco;
public class IntDomain {
public int lb, ub;
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.choco;
package bonsai.runtime.choco;
import org.chocosolver.solver.*;
import org.chocosolver.solver.exception.*;
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.choco;
package bonsai.runtime.choco;
import bonsai.chococubes.core.*;
import bonsai.runtime.core.*;
import org.chocosolver.solver.*;
import org.chocosolver.solver.variables.*;
@@ -27,7 +27,7 @@ static public VarStore bottom() {
}
public VarStore() {
this("ChocoCubes problem");
this("Bonsai problem");
}
public VarStore(String problem_name) {
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.core;
package bonsai.runtime.core;
public class EntailmentResult extends FlatLattice<Boolean> {
@@ -23,7 +23,7 @@
// The entailment and join operation are dynamically overload so `x |= y` and `x <- y` are defined such that `y` can be of type `FlatLattice<T>` or `T`.
package bonsai.chococubes.core;
package bonsai.runtime.core;
import java.util.Optional;
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.core;
package bonsai.runtime.core;
// A lattice-based variable must implement two operations over lattice: `join` for adding information and `entail` for asking if a piece of information can be deduced.
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.core;
package bonsai.runtime.core;
import java.util.Optional;
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.core;
package bonsai.runtime.core;
public class RInteger implements Restorable
{
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.core;
package bonsai.runtime.core;
public interface Restorable
{
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.core;
package bonsai.runtime.core;
public enum Spacetime {
SingleTime,
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bonsai.chococubes.core;
package bonsai.runtime.core;
// A store is a lattice-based variable with two additional methods: `alloc` and `index` where:
// * `alloc` allocates an object in the store and returns its location.
Oops, something went wrong.

0 comments on commit 04fc8bf

Please sign in to comment.