Imported unification lib using maven via JitPack.io

This commit is contained in:
Fedor Isakov 2015-12-12 13:36:37 +01:00
parent 1c9ce1f5f5
commit 8f75050b2e
16 changed files with 315 additions and 21 deletions

3
reactor/.gitignore vendored
View File

@ -1,2 +1,5 @@
.idea/workspace.xml
out
API/target/*
Core/target/*
Test/target/*

View File

@ -18,6 +18,34 @@
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
<profile default="false" name="Annotation profile for Test" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="Test" />
</profile>
<profile default="false" name="Annotation profile for Core" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="Core" />
</profile>
<profile default="false" name="Annotation profile for API" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="API" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="API" target="1.6" />
<module name="Core" target="1.6" />
<module name="main" target="1.5" />
<module name="Reactor" target="1.5" />
<module name="Test" target="1.6" />
</bytecodeTargetLevel>
</component>
</project>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/API" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/Core" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/Test" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="code-1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/fisakov/mps-unification/code/1.0/code-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@ -41,6 +41,13 @@
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
@ -51,7 +58,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SbtLocalSettings">

View File

@ -4,6 +4,7 @@
<modules>
<module fileurl="file://$PROJECT_DIR$/API/API.iml" filepath="$PROJECT_DIR$/API/API.iml" />
<module fileurl="file://$PROJECT_DIR$/Core/Core.iml" filepath="$PROJECT_DIR$/Core/Core.iml" />
<module fileurl="file://$PROJECT_DIR$/Reactor.iml" filepath="$PROJECT_DIR$/Reactor.iml" />
<module fileurl="file://$PROJECT_DIR$/Test/Test.iml" filepath="$PROJECT_DIR$/Test/Test.iml" />
</modules>
</component>

View File

@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

31
reactor/API/pom.xml Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>api</artifactId>
<parent>
<groupId>jetbrains.mps.logic.reactor</groupId>
<artifactId>main</artifactId>
<version>0.1</version>
<relativePath>..</relativePath>
</parent>
<build>
<sourceDirectory>${basedir}/src/</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="API" exported="" />
<orderEntry type="library" name="com.intellij:annotations:12.0" level="project" />
<orderEntry type="library" name="com.github.andrewoma.dexx:dexx-collections:0.2" level="project" />
<orderEntry type="library" name="org.jetbrains.kotlin:kotlin-runtime:1.0.0-beta-3595" level="project" />
<orderEntry type="library" name="org.jetbrains.kotlin:kotlin-stdlib:1.0.0-beta-3595" level="project" />
<orderEntry type="module" module-name="API" />
<orderEntry type="library" name="code-1.0" level="project" />
</component>
</module>

59
reactor/Core/pom.xml Normal file
View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>core</artifactId>
<parent>
<groupId>jetbrains.mps.logic.reactor</groupId>
<artifactId>main</artifactId>
<version>0.1</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>jetbrains.mps.logic.reactor</groupId>
<artifactId>api</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>${basedir}/src/</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>1.0.0-beta-3595</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals> <goal>compile</goal> </goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals> <goal>test-compile</goal> </goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -69,7 +69,7 @@ class ReactorPlanningSession(val name: String, val sessionSolver: SessionSolver)
private class ConstraintRegistry(val sessionSolver: SessionSolver) {
private val myConstraintArgTypes = HashMap<ConstraintSymbol, List<Class<*>>>()
private val myConstraintArgTypes = HashMap<ConstraintSymbol, List<Class<*>>>().withDefault { Collections.emptyList() }
private val myPredicateSolvers = HashMap<PredicateSymbol, Class<out Queryable>>()
@ -116,11 +116,11 @@ private class ConstraintRegistry(val sessionSolver: SessionSolver) {
unmodifiableSet(myConstraintArgTypes.keys)
fun constraintArgTypes(symbol: ConstraintSymbol): List<Class<*>> =
unmodifiableList(myConstraintArgTypes.getOrDefault(symbol, Collections.emptyList()))
unmodifiableList(myConstraintArgTypes.getOrImplicitDefault(symbol))
fun predicateSymbols(): Iterable<PredicateSymbol> =
unmodifiableSet(myPredicateSolvers.keys)
fun solverClass(symbol: PredicateSymbol): Class<out Queryable> =
myPredicateSolvers.getOrDefault(symbol, throw NoSuchElementException())
myPredicateSolvers.getOrImplicitDefault(symbol)
}

View File

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>

View File

@ -1,18 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
<orderEntry type="library" name="junit:junit:4.12" level="project" />
<orderEntry type="module" module-name="Core" scope="TEST" />
<orderEntry type="library" name="com.intellij:annotations:12.0" level="project" />
<orderEntry type="library" name="com.github.andrewoma.dexx:dexx-collections:0.2" level="project" />
<orderEntry type="library" name="org.jetbrains.kotlin:kotlin-runtime:1.0.0-beta-3595" level="project" />
<orderEntry type="library" name="org.jetbrains.kotlin:kotlin-stdlib:1.0.0-beta-3595" level="project" />
<orderEntry type="module" module-name="API" />
<orderEntry type="module" module-name="Core" />
<orderEntry type="library" name="code-1.0" level="project" />
</component>
</module>

69
reactor/Test/pom.xml Normal file
View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>tests</artifactId>
<parent>
<groupId>jetbrains.mps.logic.reactor</groupId>
<artifactId>main</artifactId>
<version>0.1</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>jetbrains.mps.logic.reactor</groupId>
<artifactId>api</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>jetbrains.mps.logic.reactor</groupId>
<artifactId>core</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testSourceDirectory>${basedir}/test/</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>1.0.0-beta-3595</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals> <goal>compile</goal> </goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals> <goal>test-compile</goal> </goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -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<AndItem>()

70
reactor/pom.xml Normal file
View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jetbrains.mps.logic.reactor</groupId>
<artifactId>main</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-runtime</artifactId>
<version>1.0.0-beta-3595</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.0.0-beta-3595</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>1.0.0-beta-3595</version>
</dependency>
<dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.github.andrewoma.dexx</groupId>
<artifactId>dexx-collections</artifactId>
<version>0.2</version>
</dependency>
<dependency>
<groupId>com.intellij</groupId>
<artifactId>annotations</artifactId>
<version>12.0</version>
</dependency>
<dependency>
<groupId>com.github.fisakov.mps-unification</groupId>
<artifactId>code</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<modules>
<module>API</module>
<module>Core</module>
<module>Test</module>
</modules>
</project>