diff --git a/reactor/.gitignore b/reactor/.gitignore index d2c8ad3b..b7dca539 100644 --- a/reactor/.gitignore +++ b/reactor/.gitignore @@ -1,2 +1,5 @@ .idea/workspace.xml out +API/target/* +Core/target/* +Test/target/* diff --git a/reactor/.idea/compiler.xml b/reactor/.idea/compiler.xml index a8523149..018b63bf 100644 --- a/reactor/.idea/compiler.xml +++ b/reactor/.idea/compiler.xml @@ -18,6 +18,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/reactor/.idea/encodings.xml b/reactor/.idea/encodings.xml index 97626ba4..7e296d3b 100644 --- a/reactor/.idea/encodings.xml +++ b/reactor/.idea/encodings.xml @@ -1,6 +1,10 @@ + + + + \ No newline at end of file diff --git a/reactor/.idea/libraries/code_1_0.xml b/reactor/.idea/libraries/code_1_0.xml new file mode 100644 index 00000000..9bab4b31 --- /dev/null +++ b/reactor/.idea/libraries/code_1_0.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/reactor/.idea/misc.xml b/reactor/.idea/misc.xml index e0057c2d..fe561da6 100644 --- a/reactor/.idea/misc.xml +++ b/reactor/.idea/misc.xml @@ -41,6 +41,13 @@ + + + @@ -51,7 +58,7 @@ - + diff --git a/reactor/.idea/modules.xml b/reactor/.idea/modules.xml index 8a083989..80bd7007 100644 --- a/reactor/.idea/modules.xml +++ b/reactor/.idea/modules.xml @@ -4,6 +4,7 @@ + diff --git a/reactor/API/API.iml b/reactor/API/API.iml index 02e7a895..9215a1af 100644 --- a/reactor/API/API.iml +++ b/reactor/API/API.iml @@ -1,9 +1,11 @@ - - - + + + + + diff --git a/reactor/API/pom.xml b/reactor/API/pom.xml new file mode 100644 index 00000000..461b985a --- /dev/null +++ b/reactor/API/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + api + + + jetbrains.mps.logic.reactor + main + 0.1 + .. + + + + ${basedir}/src/ + + + org.apache.maven.plugins + maven-compiler-plugin + 3.2 + + 1.6 + 1.6 + + + + + + diff --git a/reactor/Core/Core.iml b/reactor/Core/Core.iml index 068042b9..d604b470 100644 --- a/reactor/Core/Core.iml +++ b/reactor/Core/Core.iml @@ -1,16 +1,19 @@ - - - + + + + + - + + \ No newline at end of file diff --git a/reactor/Core/pom.xml b/reactor/Core/pom.xml new file mode 100644 index 00000000..d7738cce --- /dev/null +++ b/reactor/Core/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + core + + + jetbrains.mps.logic.reactor + main + 0.1 + .. + + + + + jetbrains.mps.logic.reactor + api + 0.1 + + + + + + ${basedir}/src/ + + + org.apache.maven.plugins + maven-compiler-plugin + 3.2 + + 1.6 + 1.6 + + + + kotlin-maven-plugin + org.jetbrains.kotlin + 1.0.0-beta-3595 + + + + compile + compile + compile + + + + test-compile + test-compile + test-compile + + + + + + + diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/ReactorPlanningSession.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/ReactorPlanningSession.kt index 1ce2525d..15a05a99 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/ReactorPlanningSession.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/ReactorPlanningSession.kt @@ -69,7 +69,7 @@ class ReactorPlanningSession(val name: String, val sessionSolver: SessionSolver) private class ConstraintRegistry(val sessionSolver: SessionSolver) { - private val myConstraintArgTypes = HashMap>>() + private val myConstraintArgTypes = HashMap>>().withDefault { Collections.emptyList() } private val myPredicateSolvers = HashMap>() @@ -116,11 +116,11 @@ private class ConstraintRegistry(val sessionSolver: SessionSolver) { unmodifiableSet(myConstraintArgTypes.keys) fun constraintArgTypes(symbol: ConstraintSymbol): List> = - unmodifiableList(myConstraintArgTypes.getOrDefault(symbol, Collections.emptyList())) + unmodifiableList(myConstraintArgTypes.getOrImplicitDefault(symbol)) fun predicateSymbols(): Iterable = unmodifiableSet(myPredicateSolvers.keys) fun solverClass(symbol: PredicateSymbol): Class = - myPredicateSolvers.getOrDefault(symbol, throw NoSuchElementException()) + myPredicateSolvers.getOrImplicitDefault(symbol) } diff --git a/reactor/Reactor.iml b/reactor/Reactor.iml index 245d3429..452b7768 100644 --- a/reactor/Reactor.iml +++ b/reactor/Reactor.iml @@ -1,12 +1,13 @@ - - - + + + + + - \ No newline at end of file diff --git a/reactor/Test/Test.iml b/reactor/Test/Test.iml index 44be45ed..ac364e94 100644 --- a/reactor/Test/Test.iml +++ b/reactor/Test/Test.iml @@ -1,18 +1,22 @@ - - - + + + + + - + - + + + \ No newline at end of file diff --git a/reactor/Test/pom.xml b/reactor/Test/pom.xml new file mode 100644 index 00000000..c31158e2 --- /dev/null +++ b/reactor/Test/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + tests + + + jetbrains.mps.logic.reactor + main + 0.1 + .. + + + + + jetbrains.mps.logic.reactor + api + 0.1 + + + jetbrains.mps.logic.reactor + core + 0.1 + + + junit + junit + 4.12 + test + + + + + ${basedir}/test/ + + + org.apache.maven.plugins + maven-compiler-plugin + 3.2 + + 1.6 + 1.6 + + + + kotlin-maven-plugin + org.jetbrains.kotlin + 1.0.0-beta-3595 + + + + compile + compile + compile + + + + test-compile + test-compile + test-compile + + + + + + + diff --git a/reactor/Test/test/RulesHelper.kt b/reactor/Test/test/RulesHelper.kt index 4a877caa..b1dcc47d 100644 --- a/reactor/Test/test/RulesHelper.kt +++ b/reactor/Test/test/RulesHelper.kt @@ -3,6 +3,7 @@ import jetbrains.mps.logic.reactor.logical.ILogical import jetbrains.mps.logic.reactor.logical.NamingContext import jetbrains.mps.logic.reactor.rule.Rule import jetbrains.mps.logic.reactor.rule.RuleBuilder +import jetbrains.mps.unification.Term import java.util.* /** @@ -68,7 +69,9 @@ fun equals(left: Any, right: Any): ConjBuilder.() -> Unit = { fun occurrence(id: String, vararg args: Any) : ConstraintOccurrence = TestOccurrence(id, * args) -class RB(tag: String, val env: Environment?) : RuleBuilder(tag) {} +class RB(tag: String, val env: Environment?) : RuleBuilder(tag) { + +} class ConjBuilder { val constraints = ArrayList() diff --git a/reactor/pom.xml b/reactor/pom.xml new file mode 100644 index 00000000..d5bebfbe --- /dev/null +++ b/reactor/pom.xml @@ -0,0 +1,70 @@ + + + 4.0.0 + + + jetbrains.mps.logic.reactor + main + 0.1 + pom + + + UTF-8 + + + + + org.jetbrains.kotlin + kotlin-runtime + 1.0.0-beta-3595 + + + org.jetbrains.kotlin + kotlin-stdlib + 1.0.0-beta-3595 + + + org.jetbrains.kotlin + kotlin-maven-plugin + 1.0.0-beta-3595 + + + com.google.collections + google-collections + 1.0 + + + com.github.andrewoma.dexx + dexx-collections + 0.2 + + + com.intellij + annotations + 12.0 + + + com.github.fisakov.mps-unification + code + 1.0 + + + + + + jitpack.io + https://jitpack.io + + + + + API + Core + Test + + + +