Imported new sources for the API
This commit is contained in:
parent
52c4df14ae
commit
9632742625
|
|
@ -0,0 +1,10 @@
|
|||
<component name="libraryTable">
|
||||
<library name="com.google.collections:google-collections:1.0" type="repository">
|
||||
<properties maven-id="com.google.collections:google-collections:1.0" />
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/google/collections/google-collections/1.0/google-collections-1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="lib">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/mps-unification/lib/hamcrest-core-1.3.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/mps-unification/lib/junit-4.11.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -3,6 +3,8 @@
|
|||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/API/API.iml" filepath="$PROJECT_DIR$/API/API.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/Bridge/Bridge.iml" filepath="$PROJECT_DIR$/Bridge/Bridge.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/Core/Core.iml" filepath="$PROJECT_DIR$/Core/Core.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -7,5 +7,6 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="com.google.collections:google-collections:1.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -48,8 +48,8 @@ public abstract class AbstractConstraint implements ComputingItem {
|
|||
return (Constraint) this;
|
||||
}
|
||||
|
||||
public AutoConstraint asAutoConstraint() {
|
||||
return (AutoConstraint) this;
|
||||
public BuiltinConstraint asAutoConstraint() {
|
||||
return (BuiltinConstraint) this;
|
||||
}
|
||||
|
||||
protected void registerHandler(ComputingSession session, Instructible instructible) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package jetbrains.mps.logic.reactor.constraint;
|
|||
/**
|
||||
* A constraint that is provided by a solver. Can be either told or asked for a constraint.
|
||||
*/
|
||||
public interface AutoConstraint extends Constraint {
|
||||
public interface BuiltinConstraint extends Constraint {
|
||||
|
||||
public Queryable solver(ComputingSession session);
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ public class ComputingSession {
|
|||
}
|
||||
|
||||
|
||||
public boolean ask(AutoConstraint autoConstraint, Object... arg) {
|
||||
public boolean ask(BuiltinConstraint autoConstraint, Object... arg) {
|
||||
Queryable solver = solver(autoConstraint);
|
||||
if (solver == null) {
|
||||
throw new IllegalStateException("no solver for '" + autoConstraint.symbol() + "'");
|
||||
|
|
@ -72,8 +72,8 @@ public class ComputingSession {
|
|||
return null;
|
||||
}
|
||||
|
||||
public AutoConstraint lookupAutoConstraint(Class<?> clazz) {
|
||||
for (Map.Entry<AutoConstraint, Queryable> e : solvers.entrySet()) {
|
||||
public BuiltinConstraint lookupAutoConstraint(Class<?> clazz) {
|
||||
for (Map.Entry<BuiltinConstraint, Queryable> e : solvers.entrySet()) {
|
||||
if (clazz.isAssignableFrom(e.getKey().solverClass())) {
|
||||
return e.getKey();
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ public class ComputingSession {
|
|||
return handlers.get(constraint);
|
||||
}
|
||||
|
||||
protected Queryable solver(AutoConstraint constraint) {
|
||||
protected Queryable solver(BuiltinConstraint constraint) {
|
||||
if (!(solvers.containsKey(constraint))) {
|
||||
throw new IllegalStateException("no handler: " + constraint);
|
||||
}
|
||||
|
|
@ -99,13 +99,13 @@ public class ComputingSession {
|
|||
handlers.put(constraint, instructible);
|
||||
}
|
||||
|
||||
protected void registerSolver(AutoConstraint constraint, Queryable queryable) {
|
||||
protected void registerSolver(BuiltinConstraint constraint, Queryable queryable) {
|
||||
solvers.put(constraint, queryable);
|
||||
}
|
||||
|
||||
private Map<Constraint, Instructible> handlers = new HashMap<Constraint, Instructible>();
|
||||
|
||||
private Map<AutoConstraint, Queryable> solvers = new HashMap<AutoConstraint, Queryable>();
|
||||
private Map<BuiltinConstraint, Queryable> solvers = new HashMap<BuiltinConstraint, Queryable>();
|
||||
|
||||
private final ComputingTracer tracer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ package jetbrains.mps.logic.reactor.constraint;
|
|||
|
||||
public interface ComputingTracer {
|
||||
|
||||
public void askSuccess(AutoConstraint autoConstraint, Object... args);
|
||||
public void askSuccess(BuiltinConstraint autoConstraint, Object... args);
|
||||
|
||||
public void askFailure(AutoConstraint autoConstraint, Object... args);
|
||||
public void askFailure(BuiltinConstraint autoConstraint, Object... args);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
package jetbrains.mps.logic.reactor.constraint;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
|
||||
/**
|
||||
* TODO: move to the constraint model
|
||||
*/
|
||||
public class ConstraintSymbol {
|
||||
|
||||
public static ConstraintSymbol symbol(String id, int arity) {
|
||||
return new ConstraintSymbol(id, arity, false);
|
||||
}
|
||||
|
||||
public static ConstraintSymbol builtinSymbol(String id, int arity) {
|
||||
return new ConstraintSymbol(id, arity, true);
|
||||
}
|
||||
|
||||
private ConstraintSymbol(String id, int arity, boolean builtin) {
|
||||
this.id = id;
|
||||
this.arity = arity;
|
||||
this.builtin = builtin;
|
||||
}
|
||||
|
||||
public String id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int arity() {
|
||||
return arity;
|
||||
}
|
||||
|
||||
public boolean isBuiltin() {
|
||||
return builtin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || this.getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ConstraintSymbol that = (ConstraintSymbol) o;
|
||||
if ((id != null ? !(id.equals(that.id)) : that.id != null)) {
|
||||
return false;
|
||||
}
|
||||
if (arity != that.arity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = 17;
|
||||
result = 43 * result + ((id != null ? String.valueOf(id).hashCode() : 0));
|
||||
result = 31 * result + 37 * arity;
|
||||
return result;
|
||||
}
|
||||
|
||||
private String id;
|
||||
private int arity;
|
||||
|
||||
private boolean builtin;
|
||||
}
|
||||
|
|
@ -5,6 +5,6 @@ package jetbrains.mps.logic.reactor.constraint;
|
|||
|
||||
public interface Queryable extends Instructible {
|
||||
|
||||
public boolean ask(AutoConstraint autoConstraint, Object... arg);
|
||||
public boolean ask(BuiltinConstraint autoConstraint, Object... arg);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package jetbrains.mps.logic.reactor.constraint;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
|
||||
public class StandardBuiltinConstraint {
|
||||
|
||||
public static final ConstraintSymbol UNIFICATION = ConstraintSymbol.builtinSymbol("=", 2);
|
||||
|
||||
public static final ConstraintSymbol EQUALS = ConstraintSymbol.builtinSymbol("==", 2);
|
||||
|
||||
public static final ConstraintSymbol ASSERT = ConstraintSymbol.builtinSymbol("assert", 1);
|
||||
|
||||
public static final ConstraintSymbol FREE = ConstraintSymbol.builtinSymbol("isVar", 1);
|
||||
|
||||
public static final ConstraintSymbol BOUND = ConstraintSymbol.builtinSymbol("isNonVar", 1);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package jetbrains.mps.logic.reactor.constraint.occurrence;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
import jetbrains.mps.logic.reactor.constraint.ConstraintSymbol;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Arrays;
|
||||
|
||||
public abstract class AbstractConstraintOccurrence {
|
||||
|
||||
protected AbstractConstraintOccurrence(ConstraintSymbol symbol, Object... arg) {
|
||||
this.symbol = symbol;
|
||||
this.arg = arg;
|
||||
}
|
||||
|
||||
public ConstraintSymbol symbol() {
|
||||
return symbol;
|
||||
}
|
||||
|
||||
public List<Object> arguments() {
|
||||
return (arg != null ? Collections.unmodifiableList(Arrays.asList(arg)) : Collections.emptyList());
|
||||
}
|
||||
|
||||
public abstract ConstraintKind kind();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + " (" + symbol + ")" + "/" + arg.length;
|
||||
}
|
||||
|
||||
private final ConstraintSymbol symbol;
|
||||
private Object[] arg;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package jetbrains.mps.logic.reactor.constraint.occurrence;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
import jetbrains.mps.logic.reactor.constraint.ConstraintSymbol;
|
||||
|
||||
public class BuiltinConstraintOccurrence extends AbstractConstraintOccurrence {
|
||||
|
||||
public static BuiltinConstraintOccurrence unitary(ConstraintSymbol symbol, Object arg) {
|
||||
if (symbol.arity() != 1) {
|
||||
throw new IllegalArgumentException("arity mismatch");
|
||||
}
|
||||
|
||||
return new BuiltinConstraintOccurrence(symbol, arg);
|
||||
}
|
||||
|
||||
public static BuiltinConstraintOccurrence binary(ConstraintSymbol symbol, Object arg1, Object arg2) {
|
||||
if (symbol.arity() != 2) {
|
||||
throw new IllegalArgumentException("arity mismatch");
|
||||
}
|
||||
|
||||
return new BuiltinConstraintOccurrence(symbol, arg1, arg2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintKind kind() {
|
||||
return ConstraintKind.BUILTIN;
|
||||
}
|
||||
|
||||
private BuiltinConstraintOccurrence(ConstraintSymbol symbol, Object... arg) {
|
||||
super(symbol, arg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package jetbrains.mps.logic.reactor.constraint.occurrence;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
|
||||
@Deprecated
|
||||
public enum ConstraintKind {
|
||||
BUILTIN(),
|
||||
USER(),
|
||||
LOGICAL(),
|
||||
JAVA();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package jetbrains.mps.logic.reactor.constraint.occurrence;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
import jetbrains.mps.logic.reactor.constraint.ConstraintSymbol;
|
||||
|
||||
public class ConstraintOccurrence extends AbstractConstraintOccurrence {
|
||||
|
||||
public static ConstraintOccurrence singleton(String id) {
|
||||
return new ConstraintOccurrence(ConstraintSymbol.symbol(id, 0));
|
||||
}
|
||||
|
||||
public static ConstraintOccurrence unitary(String id, Object arg) {
|
||||
return new ConstraintOccurrence(ConstraintSymbol.symbol(id, 1), arg);
|
||||
}
|
||||
|
||||
public static ConstraintOccurrence binary(String id, Object arg1, Object arg2) {
|
||||
return new ConstraintOccurrence(ConstraintSymbol.symbol(id, 2), arg1, arg2);
|
||||
}
|
||||
|
||||
public static ConstraintOccurrence ternary(String id, Object arg1, Object arg2, Object arg3) {
|
||||
return new ConstraintOccurrence(ConstraintSymbol.symbol(id, 3), arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
public static ConstraintOccurrence nary(String id, Object... args) {
|
||||
return new ConstraintOccurrence(ConstraintSymbol.symbol(id, args.length), args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstraintKind kind() {
|
||||
return ConstraintKind.USER;
|
||||
}
|
||||
|
||||
private ConstraintOccurrence(ConstraintSymbol symbol, Object... args) {
|
||||
super(symbol, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package jetbrains.mps.logic.reactor.constraint.occurrence;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
|
||||
public class InvalidConstraintException extends Exception {
|
||||
|
||||
public InvalidConstraintException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public InvalidConstraintException(String message, Throwable ex) {
|
||||
super(message, ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package jetbrains.mps.logic.reactor.constraint.occurrence;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
import jetbrains.mps.logic.reactor.constraint.ConstraintSymbol;
|
||||
|
||||
public class JavaConstraintOccurrence extends AbstractConstraintOccurrence {
|
||||
|
||||
public static JavaConstraintOccurrence nary(String template, Object... args) {
|
||||
return new JavaConstraintOccurrence(template, args);
|
||||
}
|
||||
|
||||
private JavaConstraintOccurrence(String template, Object... args) {
|
||||
super(ConstraintSymbol.symbol(template, args.length), args);
|
||||
}
|
||||
|
||||
public ConstraintKind kind() {
|
||||
return ConstraintKind.JAVA;
|
||||
}
|
||||
|
||||
public String toJavaString() {
|
||||
return String.valueOf(symbol());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package jetbrains.mps.logic.reactor.constraint.occurrence;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
import jetbrains.mps.logic.reactor.constraint.StandardBuiltinConstraint;
|
||||
import jetbrains.mps.logic.reactor.constraint.ConstraintSymbol;
|
||||
|
||||
public class LogicalConstraintOccurence extends AbstractConstraintOccurrence {
|
||||
|
||||
public static LogicalConstraintOccurence bound(Object logical) {
|
||||
return new LogicalConstraintOccurence(StandardBuiltinConstraint.BOUND, logical);
|
||||
}
|
||||
|
||||
public static LogicalConstraintOccurence free(Object logical) {
|
||||
return new LogicalConstraintOccurence(StandardBuiltinConstraint.FREE, logical);
|
||||
}
|
||||
|
||||
private LogicalConstraintOccurence(ConstraintSymbol symbol, Object logical) {
|
||||
super(symbol, logical);
|
||||
}
|
||||
|
||||
public ConstraintKind kind() {
|
||||
return ConstraintKind.LOGICAL;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,213 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<debug-info>
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ConstructorDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ExpressionStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.FieldDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.IfStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ReturnStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.Statement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.StaticMethodDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.SuperConstructorInvocation" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ThrowStatement" />
|
||||
<root nodeRef="r:ffe6dee4-3b51-482f-93a8-7b16b0c154a5(jetbrains.mps.logic.reactor.constraint.occurrence)/2784663291559965072">
|
||||
<file name="ConstraintKind.java">
|
||||
<unit id="2784663291559965072" at="6,0,14,0" name="jetbrains.mps.logic.reactor.constraint.occurrence.ConstraintKind" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:ffe6dee4-3b51-482f-93a8-7b16b0c154a5(jetbrains.mps.logic.reactor.constraint.occurrence)/2784663291560507288">
|
||||
<file name="JavaConstraintOccurrence.java">
|
||||
<node id="2784663291563981107" at="9,80,10,56" concept="5" />
|
||||
<node id="2784663291560517776" at="13,69,14,64" concept="8" />
|
||||
<node id="2784663291560520183" at="17,32,18,31" concept="5" />
|
||||
<node id="2784663291562781538" at="21,32,22,36" concept="5" />
|
||||
<node id="2784663291563981098" at="9,0,12,0" concept="7" trace="nary#(Ljava/lang/String;null)Ljetbrains/mps/logic/reactor/constraint/occurrence/JavaConstraintOccurrence;" />
|
||||
<node id="2784663291560508578" at="13,0,16,0" concept="0" trace="JavaConstraintOccurrence#(Ljava/lang/String;null)V" />
|
||||
<node id="2784663291560507908" at="17,0,20,0" concept="4" trace="kind#()Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintKind;" />
|
||||
<node id="2784663291562776140" at="21,0,24,0" concept="4" trace="toJavaString#()Ljava/lang/String;" />
|
||||
<scope id="2784663291563981106" at="9,80,10,56" />
|
||||
<scope id="2784663291560508582" at="13,69,14,64" />
|
||||
<scope id="2784663291560507912" at="17,32,18,31" />
|
||||
<scope id="2784663291562776144" at="21,32,22,36" />
|
||||
<scope id="2784663291563981098" at="9,0,12,0">
|
||||
<var name="args" id="2784663291563981101" />
|
||||
<var name="template" id="2784663291563981099" />
|
||||
</scope>
|
||||
<scope id="2784663291560508578" at="13,0,16,0">
|
||||
<var name="args" id="2784663291560510671" />
|
||||
<var name="template" id="2784663291560510508" />
|
||||
</scope>
|
||||
<scope id="2784663291560507908" at="17,0,20,0" />
|
||||
<scope id="2784663291562776140" at="21,0,24,0" />
|
||||
<unit id="2784663291560507288" at="7,0,26,0" name="jetbrains.mps.logic.reactor.constraint.occurrence.JavaConstraintOccurrence" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:ffe6dee4-3b51-482f-93a8-7b16b0c154a5(jetbrains.mps.logic.reactor.constraint.occurrence)/5841747851378918959">
|
||||
<file name="LogicalConstraintOccurence.java">
|
||||
<node id="5841747851379152189" at="10,66,11,84" concept="5" />
|
||||
<node id="5841747851379166327" at="14,65,15,83" concept="5" />
|
||||
<node id="5841747851378925055" at="18,79,19,27" concept="8" />
|
||||
<node id="5841747851378922406" at="22,32,23,34" concept="5" />
|
||||
<node id="5841747851379151158" at="10,0,13,0" concept="7" trace="bound#(Ljava/lang/Object;)Ljetbrains/mps/logic/reactor/constraint/occurrence/LogicalConstraintOccurence;" />
|
||||
<node id="5841747851379166321" at="14,0,17,0" concept="7" trace="free#(Ljava/lang/Object;)Ljetbrains/mps/logic/reactor/constraint/occurrence/LogicalConstraintOccurence;" />
|
||||
<node id="5841747851378924851" at="18,0,21,0" concept="0" trace="LogicalConstraintOccurence#(Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;Ljava/lang/Object;)V" />
|
||||
<node id="5841747851378921991" at="22,0,25,0" concept="4" trace="kind#()Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintKind;" />
|
||||
<scope id="5841747851379151162" at="10,66,11,84" />
|
||||
<scope id="5841747851379166326" at="14,65,15,83" />
|
||||
<scope id="5841747851378924855" at="18,79,19,27" />
|
||||
<scope id="5841747851378921995" at="22,32,23,34" />
|
||||
<scope id="5841747851379151158" at="10,0,13,0">
|
||||
<var name="logical" id="5841747851379151823" />
|
||||
</scope>
|
||||
<scope id="5841747851379166321" at="14,0,17,0">
|
||||
<var name="logical" id="5841747851379166322" />
|
||||
</scope>
|
||||
<scope id="5841747851378924851" at="18,0,21,0">
|
||||
<var name="logical" id="5841747851378925889" />
|
||||
<var name="symbol" id="5841747851378925673" />
|
||||
</scope>
|
||||
<scope id="5841747851378921991" at="22,0,25,0" />
|
||||
<unit id="5841747851378918959" at="8,0,27,0" name="jetbrains.mps.logic.reactor.constraint.occurrence.LogicalConstraintOccurence" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:ffe6dee4-3b51-482f-93a8-7b16b0c154a5(jetbrains.mps.logic.reactor.constraint.occurrence)/8335224865064894913">
|
||||
<file name="BuiltinConstraintOccurrence.java">
|
||||
<node id="2581717380588396588" at="10,30,11,59" concept="9" />
|
||||
<node id="2581717380588402908" at="12,5,13,0" concept="6" />
|
||||
<node id="8335224865064894923" at="13,0,14,56" concept="5" />
|
||||
<node id="2581717380588403000" at="18,30,19,59" concept="9" />
|
||||
<node id="2581717380588405966" at="20,5,21,0" concept="6" />
|
||||
<node id="8335224865064894939" at="21,0,22,63" concept="5" />
|
||||
<node id="2784663291560133958" at="26,32,27,34" concept="5" />
|
||||
<node id="8335224865064894991" at="30,79,31,23" concept="8" />
|
||||
<node id="2581717380588393974" at="9,90,12,5" concept="3" />
|
||||
<node id="2581717380588402998" at="17,103,20,5" concept="3" />
|
||||
<node id="8335224865064894982" at="30,0,33,0" concept="0" trace="BuiltinConstraintOccurrence#(Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;null)V" />
|
||||
<node id="2784663291560132331" at="25,0,29,0" concept="4" trace="kind#()Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintKind;" />
|
||||
<node id="8335224865064894915" at="9,0,16,0" concept="7" trace="unitary#(Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;Ljava/lang/Object;)Ljetbrains/mps/logic/reactor/constraint/occurrence/BuiltinConstraintOccurrence;" />
|
||||
<node id="8335224865064894929" at="17,0,24,0" concept="7" trace="binary#(Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;Ljava/lang/Object;Ljava/lang/Object;)Ljetbrains/mps/logic/reactor/constraint/occurrence/BuiltinConstraintOccurrence;" />
|
||||
<scope id="2581717380588393977" at="10,30,11,59" />
|
||||
<scope id="2581717380588402999" at="18,30,19,59" />
|
||||
<scope id="2784663291560132335" at="26,32,27,34" />
|
||||
<scope id="8335224865064894990" at="30,79,31,23" />
|
||||
<scope id="8335224865064894982" at="30,0,33,0">
|
||||
<var name="arg" id="8335224865064894985" />
|
||||
<var name="symbol" id="8335224865064894983" />
|
||||
</scope>
|
||||
<scope id="2784663291560132331" at="25,0,29,0" />
|
||||
<scope id="8335224865064894922" at="9,90,14,56" />
|
||||
<scope id="8335224865064894938" at="17,103,22,63" />
|
||||
<scope id="8335224865064894915" at="9,0,16,0">
|
||||
<var name="arg" id="8335224865064894918" />
|
||||
<var name="symbol" id="8335224865064894916" />
|
||||
</scope>
|
||||
<scope id="8335224865064894929" at="17,0,24,0">
|
||||
<var name="arg1" id="8335224865064894932" />
|
||||
<var name="arg2" id="8335224865064894934" />
|
||||
<var name="symbol" id="8335224865064894930" />
|
||||
</scope>
|
||||
<unit id="8335224865064894913" at="7,0,35,0" name="jetbrains.mps.logic.reactor.constraint.occurrence.BuiltinConstraintOccurrence" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:ffe6dee4-3b51-482f-93a8-7b16b0c154a5(jetbrains.mps.logic.reactor.constraint.occurrence)/8335224865064894996">
|
||||
<file name="AbstractConstraintOccurrence.java">
|
||||
<node id="8335224865064895007" at="12,82,13,25" concept="1" />
|
||||
<node id="8335224865064895013" at="13,25,14,19" concept="1" />
|
||||
<node id="8335224865064895024" at="17,36,18,18" concept="5" />
|
||||
<node id="8335224865064895046" at="21,35,22,102" concept="5" />
|
||||
<node id="2784663291559977205" at="25,0,26,0" concept="4" trace="kind#()Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintKind;" />
|
||||
<node id="9010599623176893011" at="28,28,29,79" concept="5" />
|
||||
<node id="8335224865064895067" at="32,0,33,0" concept="2" trace="symbol" />
|
||||
<node id="8335224865064895070" at="33,0,34,0" concept="2" trace="arg" />
|
||||
<node id="8335224865064895020" at="17,0,20,0" concept="4" trace="symbol#()Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;" />
|
||||
<node id="8335224865064895041" at="21,0,24,0" concept="4" trace="arguments#()Ljava/util/List;" />
|
||||
<node id="8335224865064894998" at="12,0,16,0" concept="0" trace="AbstractConstraintOccurrence#(Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;null)V" />
|
||||
<node id="9010599623176891835" at="27,0,31,0" concept="4" trace="toString#()Ljava/lang/String;" />
|
||||
<scope id="8335224865064895023" at="17,36,18,18" />
|
||||
<scope id="8335224865064895045" at="21,35,22,102" />
|
||||
<scope id="2784663291559977205" at="25,0,26,0" />
|
||||
<scope id="9010599623176891839" at="28,28,29,79" />
|
||||
<scope id="8335224865064895006" at="12,82,14,19" />
|
||||
<scope id="8335224865064895020" at="17,0,20,0" />
|
||||
<scope id="8335224865064895041" at="21,0,24,0" />
|
||||
<scope id="8335224865064894998" at="12,0,16,0">
|
||||
<var name="arg" id="8335224865064895001" />
|
||||
<var name="symbol" id="8335224865064894999" />
|
||||
</scope>
|
||||
<scope id="9010599623176891835" at="27,0,31,0" />
|
||||
<unit id="8335224865064894996" at="10,0,35,0" name="jetbrains.mps.logic.reactor.constraint.occurrence.AbstractConstraintOccurrence" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:ffe6dee4-3b51-482f-93a8-7b16b0c154a5(jetbrains.mps.logic.reactor.constraint.occurrence)/8335224865064895431">
|
||||
<file name="ConstraintOccurrence.java">
|
||||
<node id="8490564095239761549" at="9,59,10,68" concept="5" />
|
||||
<node id="8335224865064895441" at="13,69,14,73" concept="5" />
|
||||
<node id="8335224865064895457" at="17,82,18,80" concept="5" />
|
||||
<node id="8335224865064895476" at="21,96,22,86" concept="5" />
|
||||
<node id="6135434422634372105" at="25,70,26,84" concept="5" />
|
||||
<node id="2784663291560143129" at="30,32,31,31" concept="5" />
|
||||
<node id="8335224865064895510" at="34,73,35,24" concept="8" />
|
||||
<node id="8490564095239761541" at="9,0,12,0" concept="7" trace="singleton#(Ljava/lang/String;)Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintOccurrence;" />
|
||||
<node id="8335224865064895433" at="13,0,16,0" concept="7" trace="unitary#(Ljava/lang/String;Ljava/lang/Object;)Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintOccurrence;" />
|
||||
<node id="8335224865064895447" at="17,0,20,0" concept="7" trace="binary#(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintOccurrence;" />
|
||||
<node id="8335224865064895464" at="21,0,24,0" concept="7" trace="ternary#(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintOccurrence;" />
|
||||
<node id="6135434422634372093" at="25,0,28,0" concept="7" trace="nary#(Ljava/lang/String;null)Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintOccurrence;" />
|
||||
<node id="8335224865064895501" at="34,0,37,0" concept="0" trace="ConstraintOccurrence#(Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;null)V" />
|
||||
<node id="2784663291560140676" at="29,0,33,0" concept="4" trace="kind#()Ljetbrains/mps/logic/reactor/constraint/occurrence/ConstraintKind;" />
|
||||
<scope id="8490564095239761548" at="9,59,10,68" />
|
||||
<scope id="8335224865064895440" at="13,69,14,73" />
|
||||
<scope id="8335224865064895456" at="17,82,18,80" />
|
||||
<scope id="8335224865064895475" at="21,96,22,86" />
|
||||
<scope id="6135434422634372104" at="25,70,26,84" />
|
||||
<scope id="2784663291560140680" at="30,32,31,31" />
|
||||
<scope id="8335224865064895509" at="34,73,35,24" />
|
||||
<scope id="8490564095239761541" at="9,0,12,0">
|
||||
<var name="id" id="8490564095239761542" />
|
||||
</scope>
|
||||
<scope id="8335224865064895433" at="13,0,16,0">
|
||||
<var name="arg" id="8335224865064895436" />
|
||||
<var name="id" id="8335224865064895434" />
|
||||
</scope>
|
||||
<scope id="8335224865064895447" at="17,0,20,0">
|
||||
<var name="arg1" id="8335224865064895450" />
|
||||
<var name="arg2" id="8335224865064895452" />
|
||||
<var name="id" id="8335224865064895448" />
|
||||
</scope>
|
||||
<scope id="8335224865064895464" at="21,0,24,0">
|
||||
<var name="arg1" id="8335224865064895467" />
|
||||
<var name="arg2" id="8335224865064895469" />
|
||||
<var name="arg3" id="8335224865064895471" />
|
||||
<var name="id" id="8335224865064895465" />
|
||||
</scope>
|
||||
<scope id="6135434422634372093" at="25,0,28,0">
|
||||
<var name="args" id="6135434422634376039" />
|
||||
<var name="id" id="6135434422634372094" />
|
||||
</scope>
|
||||
<scope id="8335224865064895501" at="34,0,37,0">
|
||||
<var name="args" id="8335224865064895504" />
|
||||
<var name="symbol" id="8335224865064895502" />
|
||||
</scope>
|
||||
<scope id="2784663291560140676" at="29,0,33,0" />
|
||||
<unit id="8335224865064895431" at="7,0,39,0" name="jetbrains.mps.logic.reactor.constraint.occurrence.ConstraintOccurrence" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:ffe6dee4-3b51-482f-93a8-7b16b0c154a5(jetbrains.mps.logic.reactor.constraint.occurrence)/9010599623176680927">
|
||||
<file name="InvalidConstraintException.java">
|
||||
<node id="9010599623176682194" at="8,53,9,19" concept="8" />
|
||||
<node id="9010599623176682617" at="12,67,13,23" concept="8" />
|
||||
<node id="9010599623176682144" at="8,0,11,0" concept="0" trace="InvalidConstraintException#(Ljava/lang/String;)V" />
|
||||
<node id="9010599623176682613" at="12,0,15,0" concept="0" trace="InvalidConstraintException#(Ljava/lang/String;Ljava/lang/Throwable;)V" />
|
||||
<scope id="9010599623176682148" at="8,53,9,19" />
|
||||
<scope id="9010599623176682616" at="12,67,13,23" />
|
||||
<scope id="9010599623176682144" at="8,0,11,0">
|
||||
<var name="message" id="9010599623176682158" />
|
||||
</scope>
|
||||
<scope id="9010599623176682613" at="12,0,15,0">
|
||||
<var name="ex" id="9010599623176682960" />
|
||||
<var name="message" id="9010599623176682619" />
|
||||
</scope>
|
||||
<unit id="9010599623176680927" at="6,0,17,0" name="jetbrains.mps.logic.reactor.constraint.occurrence.InvalidConstraintException" />
|
||||
</file>
|
||||
</root>
|
||||
</debug-info>
|
||||
|
||||
|
|
@ -9,12 +9,13 @@
|
|||
<concept fqn="jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ReturnStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.Statement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.StaticFieldDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.StaticMethodDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ThrowStatement" />
|
||||
<root nodeRef="r:2a79c8aa-e372-4c00-8d71-5d7f3db517e4(jetbrains.mps.logic.reactor.constraint)/2394628030058821331">
|
||||
<file name="ComputingTracer.java">
|
||||
<node id="2394628030058889702" at="8,0,9,0" concept="5" trace="askSuccess#(Ljetbrains/mps/logic/reactor/constraint/AutoConstraint;null)V" />
|
||||
<node id="2394628030058891476" at="10,0,11,0" concept="5" trace="askFailure#(Ljetbrains/mps/logic/reactor/constraint/AutoConstraint;null)V" />
|
||||
<node id="2394628030058889702" at="8,0,9,0" concept="5" trace="askSuccess#(Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;null)V" />
|
||||
<node id="2394628030058891476" at="10,0,11,0" concept="5" trace="askFailure#(Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;null)V" />
|
||||
<scope id="2394628030058889702" at="8,0,9,0">
|
||||
<var name="args" id="2394628030058890766" />
|
||||
<var name="autoConstraint" id="2394628030058890707" />
|
||||
|
|
@ -26,6 +27,96 @@
|
|||
<unit id="2394628030058821331" at="6,0,13,0" name="jetbrains.mps.logic.reactor.constraint.ComputingTracer" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:2a79c8aa-e372-4c00-8d71-5d7f3db517e4(jetbrains.mps.logic.reactor.constraint)/3476135434776862742">
|
||||
<file name="StandardBuiltinConstraint.java">
|
||||
<node id="5841747851381517634" at="8,0,9,0" concept="9" trace="UNIFICATION" />
|
||||
<node id="3058061960966978300" at="10,0,11,0" concept="9" trace="EQUALS" />
|
||||
<node id="7248331023826512162" at="12,0,13,0" concept="9" trace="ASSERT" />
|
||||
<node id="5841747851381521369" at="14,0,15,0" concept="9" trace="FREE" />
|
||||
<node id="5841747851381522500" at="16,0,17,0" concept="9" trace="BOUND" />
|
||||
<unit id="3476135434776862742" at="6,0,19,0" name="jetbrains.mps.logic.reactor.constraint.StandardBuiltinConstraint" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:2a79c8aa-e372-4c00-8d71-5d7f3db517e4(jetbrains.mps.logic.reactor.constraint)/5841747851381496683">
|
||||
<file name="ConstraintSymbol.java">
|
||||
<node id="5841747851381535271" at="11,63,12,50" concept="7" />
|
||||
<node id="3476135434777575187" at="15,70,16,49" concept="7" />
|
||||
<node id="5841747851381516232" at="19,67,20,17" concept="1" />
|
||||
<node id="5841747851381516238" at="20,17,21,23" concept="1" />
|
||||
<node id="3476135434777577551" at="21,23,22,27" concept="1" />
|
||||
<node id="5841747851381516257" at="25,22,26,14" concept="7" />
|
||||
<node id="5841747851381516264" at="29,22,30,17" concept="7" />
|
||||
<node id="3476135434779310079" at="33,30,34,19" concept="7" />
|
||||
<node id="5841747851383361011" at="38,28,39,14" concept="7" />
|
||||
<node id="5841747851381863158" at="44,20,45,18" concept="7" />
|
||||
<node id="5841747851381863164" at="47,55,48,19" concept="7" />
|
||||
<node id="5841747851381863177" at="49,5,50,0" concept="8" />
|
||||
<node id="5841747851381863178" at="50,0,51,49" concept="6" />
|
||||
<node id="5841747851381863196" at="52,65,53,19" concept="7" />
|
||||
<node id="5841747851381863219" at="55,30,56,19" concept="7" />
|
||||
<node id="5841747851381863221" at="57,5,58,0" concept="8" />
|
||||
<node id="5841747851381863222" at="58,0,59,16" concept="7" />
|
||||
<node id="5841747851381863229" at="63,25,64,20" concept="6" />
|
||||
<node id="5841747851381863242" at="64,20,65,78" concept="1" />
|
||||
<node id="5841747851381863258" at="65,78,66,38" concept="1" />
|
||||
<node id="5841747851381863262" at="66,38,67,18" concept="7" />
|
||||
<node id="5841747851381516267" at="70,0,71,0" concept="2" trace="id" />
|
||||
<node id="5841747851381516270" at="71,0,72,0" concept="2" trace="arity" />
|
||||
<node id="3476135434777577547" at="73,0,74,0" concept="2" trace="builtin" />
|
||||
<node id="5841747851381533067" at="11,0,14,0" concept="10" trace="symbol#(Ljava/lang/String;I)Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;" />
|
||||
<node id="3476135434777575179" at="15,0,18,0" concept="10" trace="builtinSymbol#(Ljava/lang/String;I)Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;" />
|
||||
<node id="5841747851381516253" at="25,0,28,0" concept="5" trace="id#()Ljava/lang/String;" />
|
||||
<node id="5841747851381516260" at="29,0,32,0" concept="5" trace="arity#()I" />
|
||||
<node id="3476135434779305117" at="33,0,36,0" concept="5" trace="isBuiltin#()Z" />
|
||||
<node id="5841747851381863156" at="43,35,46,5" concept="4" />
|
||||
<node id="5841747851381863162" at="46,5,49,5" concept="4" />
|
||||
<node id="5841747851381863194" at="51,49,54,5" concept="4" />
|
||||
<node id="5841747851381863214" at="54,5,57,5" concept="4" />
|
||||
<node id="5841747851383347181" at="37,0,41,0" concept="5" trace="toString#()Ljava/lang/String;" />
|
||||
<node id="5841747851381516224" at="19,0,24,0" concept="0" trace="ConstraintSymbol#(Ljava/lang/String;IZ)V" />
|
||||
<node id="5841747851381863224" at="62,0,69,0" concept="5" trace="hashCode#()I" />
|
||||
<node id="5841747851381863152" at="42,0,61,0" concept="5" trace="equals#(Ljava/lang/Object;)Z" />
|
||||
<scope id="5841747851381533071" at="11,63,12,50" />
|
||||
<scope id="3476135434777575186" at="15,70,16,49" />
|
||||
<scope id="5841747851381516256" at="25,22,26,14" />
|
||||
<scope id="5841747851381516263" at="29,22,30,17" />
|
||||
<scope id="3476135434779305121" at="33,30,34,19" />
|
||||
<scope id="5841747851383347185" at="38,28,39,14" />
|
||||
<scope id="5841747851381863157" at="44,20,45,18" />
|
||||
<scope id="5841747851381863163" at="47,55,48,19" />
|
||||
<scope id="5841747851381863195" at="52,65,53,19" />
|
||||
<scope id="5841747851381863218" at="55,30,56,19" />
|
||||
<scope id="5841747851381533067" at="11,0,14,0">
|
||||
<var name="arity" id="5841747851381534850" />
|
||||
<var name="id" id="5841747851381534602" />
|
||||
</scope>
|
||||
<scope id="3476135434777575179" at="15,0,18,0">
|
||||
<var name="arity" id="3476135434777575182" />
|
||||
<var name="id" id="3476135434777575180" />
|
||||
</scope>
|
||||
<scope id="5841747851381516231" at="19,67,22,27" />
|
||||
<scope id="5841747851381516253" at="25,0,28,0" />
|
||||
<scope id="5841747851381516260" at="29,0,32,0" />
|
||||
<scope id="3476135434779305117" at="33,0,36,0" />
|
||||
<scope id="5841747851383347181" at="37,0,41,0" />
|
||||
<scope id="5841747851381863227" at="63,25,67,18">
|
||||
<var name="result" id="5841747851381863230" />
|
||||
</scope>
|
||||
<scope id="5841747851381516224" at="19,0,24,0">
|
||||
<var name="arity" id="5841747851381516227" />
|
||||
<var name="builtin" id="3476135434777577153" />
|
||||
<var name="id" id="5841747851381516225" />
|
||||
</scope>
|
||||
<scope id="5841747851381863224" at="62,0,69,0" />
|
||||
<scope id="5841747851381863155" at="43,35,59,16">
|
||||
<var name="that" id="5841747851381863179" />
|
||||
</scope>
|
||||
<scope id="5841747851381863152" at="42,0,61,0">
|
||||
<var name="o" id="5841747851381863184" />
|
||||
</scope>
|
||||
<unit id="5841747851381496683" at="9,0,75,0" name="jetbrains.mps.logic.reactor.constraint.ConstraintSymbol" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:2a79c8aa-e372-4c00-8d71-5d7f3db517e4(jetbrains.mps.logic.reactor.constraint)/7785665572546273004">
|
||||
<file name="Instructible.java">
|
||||
<node id="7785665572546273471" at="8,0,9,0" concept="5" trace="tell#(Ljetbrains/mps/logic/reactor/constraint/Constraint;null)V" />
|
||||
|
|
@ -38,7 +129,7 @@
|
|||
</root>
|
||||
<root nodeRef="r:2a79c8aa-e372-4c00-8d71-5d7f3db517e4(jetbrains.mps.logic.reactor.constraint)/7785665572546275793">
|
||||
<file name="Queryable.java">
|
||||
<node id="7785665572546276256" at="8,0,9,0" concept="5" trace="ask#(Ljetbrains/mps/logic/reactor/constraint/AutoConstraint;null)Z" />
|
||||
<node id="7785665572546276256" at="8,0,9,0" concept="5" trace="ask#(Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;null)Z" />
|
||||
<scope id="7785665572546276256" at="8,0,9,0">
|
||||
<var name="arg" id="7785665572546277217" />
|
||||
<var name="autoConstraint" id="5217246026231849983" />
|
||||
|
|
@ -58,49 +149,49 @@
|
|||
<node id="7785665572546655075" at="39,7,40,21" concept="7" />
|
||||
<node id="7785665572546549222" at="43,0,44,0" concept="2" trace="items" />
|
||||
<node id="2394628030058826202" at="44,0,45,0" concept="2" trace="tracer" />
|
||||
<node id="5217246026231909736" at="48,68,49,46" concept="6" />
|
||||
<node id="3113146058921147309" at="50,25,51,89" concept="10" />
|
||||
<node id="5217246026231909736" at="48,71,49,46" concept="6" />
|
||||
<node id="3113146058921147309" at="50,25,51,89" concept="11" />
|
||||
<node id="5217246026231915015" at="52,5,53,0" concept="8" />
|
||||
<node id="5217246026231915802" at="53,0,54,43" concept="7" />
|
||||
<node id="5217246026231937543" at="57,58,58,47" concept="6" />
|
||||
<node id="5217246026231938307" at="59,26,60,84" concept="10" />
|
||||
<node id="5217246026231938307" at="59,26,60,84" concept="11" />
|
||||
<node id="5217246026231939616" at="61,5,62,0" concept="8" />
|
||||
<node id="5217246026231940146" at="62,0,63,34" concept="1" />
|
||||
<node id="5217246026233198367" at="68,62,69,26" concept="7" />
|
||||
<node id="5217246026233198386" at="71,5,72,16" concept="7" />
|
||||
<node id="5217246026233178759" at="77,61,78,26" concept="7" />
|
||||
<node id="5217246026233191067" at="80,5,81,16" concept="7" />
|
||||
<node id="7785665572546314459" at="85,46,86,67" concept="10" />
|
||||
<node id="7785665572546314459" at="85,46,86,67" concept="11" />
|
||||
<node id="7785665572546321112" at="87,5,88,36" concept="7" />
|
||||
<node id="7785665572546325981" at="92,45,93,67" concept="10" />
|
||||
<node id="7785665572546325981" at="92,45,93,67" concept="11" />
|
||||
<node id="7785665572546325992" at="94,5,95,35" concept="7" />
|
||||
<node id="7785665572546331232" at="98,84,99,43" concept="1" />
|
||||
<node id="7785665572546333582" at="102,81,103,39" concept="1" />
|
||||
<node id="7785665572546333582" at="102,84,103,39" concept="1" />
|
||||
<node id="3113146058921098945" at="106,0,107,0" concept="2" trace="handlers" />
|
||||
<node id="7785665572546302065" at="108,0,109,0" concept="2" trace="solvers" />
|
||||
<node id="2394628030058867716" at="110,0,111,0" concept="2" trace="tracer" />
|
||||
<node id="7785665572546530345" at="16,0,19,0" concept="9" trace="with#(null)Ljetbrains/mps/logic/reactor/constraint/ComputingSession/Builder;" />
|
||||
<node id="7785665572546530345" at="16,0,19,0" concept="10" trace="with#(null)Ljetbrains/mps/logic/reactor/constraint/ComputingSession/Builder;" />
|
||||
<node id="7785665572546474667" at="20,0,23,0" concept="0" trace="ComputingSession#(Ljetbrains/mps/logic/reactor/constraint/ComputingTracer;)V" />
|
||||
<node id="7785665572546531299" at="26,0,29,0" concept="0" trace="Builder#(null)V" />
|
||||
<node id="7785665572546618363" at="36,62,39,7" concept="3" />
|
||||
<node id="5217246026231909836" at="49,46,52,5" concept="4" />
|
||||
<node id="5217246026231937636" at="58,47,61,5" concept="4" />
|
||||
<node id="5217246026233198365" at="67,71,70,7" concept="4" />
|
||||
<node id="5217246026233173468" at="76,71,79,7" concept="4" />
|
||||
<node id="5217246026233173468" at="76,74,79,7" concept="4" />
|
||||
<node id="7785665572546312340" at="84,57,87,5" concept="4" />
|
||||
<node id="7785665572546325979" at="91,57,94,5" concept="4" />
|
||||
<node id="7785665572546325979" at="91,60,94,5" concept="4" />
|
||||
<node id="7785665572546291885" at="98,0,101,0" concept="5" trace="registerHandler#(Ljetbrains/mps/logic/reactor/constraint/Constraint;Ljetbrains/mps/logic/reactor/constraint/Instructible;)V" />
|
||||
<node id="7785665572546292859" at="102,0,105,0" concept="5" trace="registerSolver#(Ljetbrains/mps/logic/reactor/constraint/AutoConstraint;Ljetbrains/mps/logic/reactor/constraint/Queryable;)V" />
|
||||
<node id="7785665572546292859" at="102,0,105,0" concept="5" trace="registerSolver#(Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;Ljetbrains/mps/logic/reactor/constraint/Queryable;)V" />
|
||||
<node id="2394628030058805485" at="30,0,34,0" concept="5" trace="withTracer#(Ljetbrains/mps/logic/reactor/constraint/ComputingTracer;)Ljetbrains/mps/logic/reactor/constraint/ComputingSession/Builder;" />
|
||||
<node id="5217246026233198363" at="66,54,71,5" concept="3" />
|
||||
<node id="5217246026233172453" at="75,62,80,5" concept="3" />
|
||||
<node id="5217246026233172453" at="75,65,80,5" concept="3" />
|
||||
<node id="7785665572546284968" at="84,0,90,0" concept="5" trace="handler#(Ljetbrains/mps/logic/reactor/constraint/Constraint;)Ljetbrains/mps/logic/reactor/constraint/Instructible;" />
|
||||
<node id="7785665572546285620" at="91,0,97,0" concept="5" trace="solver#(Ljetbrains/mps/logic/reactor/constraint/AutoConstraint;)Ljetbrains/mps/logic/reactor/constraint/Queryable;" />
|
||||
<node id="7785665572546285620" at="91,0,97,0" concept="5" trace="solver#(Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;)Ljetbrains/mps/logic/reactor/constraint/Queryable;" />
|
||||
<node id="7785665572546610892" at="35,0,42,0" concept="5" trace="newSession#()Ljetbrains/mps/logic/reactor/constraint/ComputingSession;" />
|
||||
<node id="5217246026231897797" at="48,0,56,0" concept="5" trace="ask#(Ljetbrains/mps/logic/reactor/constraint/AutoConstraint;null)Z" />
|
||||
<node id="5217246026231897797" at="48,0,56,0" concept="5" trace="ask#(Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;null)Z" />
|
||||
<node id="5217246026231929908" at="57,0,65,0" concept="5" trace="tell#(Ljetbrains/mps/logic/reactor/constraint/Constraint;null)V" />
|
||||
<node id="5217246026233138983" at="66,0,74,0" concept="5" trace="lookupConstraint#(Ljava/lang/Class;)Ljetbrains/mps/logic/reactor/constraint/Constraint;" />
|
||||
<node id="5217246026233157724" at="75,0,83,0" concept="5" trace="lookupAutoConstraint#(Ljava/lang/Class;)Ljetbrains/mps/logic/reactor/constraint/AutoConstraint;" />
|
||||
<node id="5217246026233157724" at="75,0,83,0" concept="5" trace="lookupAutoConstraint#(Ljava/lang/Class;)Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;" />
|
||||
<scope id="7785665572546530349" at="16,69,17,45" />
|
||||
<scope id="7785665572546474671" at="20,52,21,25" />
|
||||
<scope id="7785665572546531302" at="26,44,27,40" />
|
||||
|
|
@ -112,7 +203,7 @@
|
|||
<scope id="7785665572546312341" at="85,46,86,67" />
|
||||
<scope id="7785665572546325980" at="92,45,93,67" />
|
||||
<scope id="7785665572546291889" at="98,84,99,43" />
|
||||
<scope id="7785665572546292862" at="102,81,103,39" />
|
||||
<scope id="7785665572546292862" at="102,84,103,39" />
|
||||
<scope id="2394628030058805489" at="30,72,32,18" />
|
||||
<scope id="7785665572546530345" at="16,0,19,0">
|
||||
<var name="cst" id="7785665572546531671" />
|
||||
|
|
@ -127,7 +218,7 @@
|
|||
<var name="ci" id="7785665572546618367" />
|
||||
</scope>
|
||||
<scope id="5217246026233198364" at="67,71,70,7" />
|
||||
<scope id="5217246026233172455" at="76,71,79,7" />
|
||||
<scope id="5217246026233172455" at="76,74,79,7" />
|
||||
<scope id="7785665572546291885" at="98,0,101,0">
|
||||
<var name="constraint" id="7785665572546292483" />
|
||||
<var name="instructible" id="7785665572546292614" />
|
||||
|
|
@ -140,24 +231,24 @@
|
|||
<var name="tracer" id="2394628030058811857" />
|
||||
</scope>
|
||||
<scope id="7785665572546284972" at="84,57,88,36" />
|
||||
<scope id="7785665572546285625" at="91,57,95,35" />
|
||||
<scope id="7785665572546285625" at="91,60,95,35" />
|
||||
<scope id="7785665572546610895" at="35,42,40,21">
|
||||
<var name="session" id="7785665572546617945" />
|
||||
</scope>
|
||||
<scope id="5217246026233198363" at="66,54,71,5">
|
||||
<var name="e" id="5217246026233198379" />
|
||||
</scope>
|
||||
<scope id="5217246026233172453" at="75,62,80,5">
|
||||
<scope id="5217246026233172453" at="75,65,80,5">
|
||||
<var name="e" id="5217246026233172457" />
|
||||
</scope>
|
||||
<scope id="5217246026231897801" at="48,68,54,43">
|
||||
<scope id="5217246026231897801" at="48,71,54,43">
|
||||
<var name="solver" id="5217246026231909737" />
|
||||
</scope>
|
||||
<scope id="5217246026231929912" at="57,58,63,34">
|
||||
<var name="handler" id="5217246026231937544" />
|
||||
</scope>
|
||||
<scope id="5217246026233138987" at="66,54,72,16" />
|
||||
<scope id="5217246026233157731" at="75,62,81,16" />
|
||||
<scope id="5217246026233157731" at="75,65,81,16" />
|
||||
<scope id="7785665572546284968" at="84,0,90,0">
|
||||
<var name="constraint" id="7785665572546285221" />
|
||||
</scope>
|
||||
|
|
@ -196,7 +287,7 @@
|
|||
<node id="5217246026233035232" at="38,55,39,25" concept="7" />
|
||||
<node id="7785665572546318932" at="43,28,44,18" concept="7" />
|
||||
<node id="7785665572546684117" at="47,36,48,29" concept="7" />
|
||||
<node id="7785665572546684168" at="51,44,52,33" concept="7" />
|
||||
<node id="7785665572546684168" at="51,47,52,36" concept="7" />
|
||||
<node id="7785665572546404455" at="55,87,56,58" concept="1" />
|
||||
<node id="7785665572546406620" at="59,80,60,58" concept="1" />
|
||||
<node id="5217246026234681809" at="60,58,61,55" concept="1" />
|
||||
|
|
@ -219,7 +310,7 @@
|
|||
<node id="7785665572546421640" at="32,0,35,0" concept="5" trace="solver#(Ljetbrains/mps/logic/reactor/constraint/ComputingSession;)Ljetbrains/mps/logic/reactor/constraint/Queryable;" />
|
||||
<node id="5217246026233026711" at="38,0,41,0" concept="5" trace="handlerClass#()Ljava/lang/Class;" />
|
||||
<node id="7785665572546678499" at="47,0,50,0" concept="5" trace="asConstraint#()Ljetbrains/mps/logic/reactor/constraint/Constraint;" />
|
||||
<node id="7785665572546684164" at="51,0,54,0" concept="5" trace="asAutoConstraint#()Ljetbrains/mps/logic/reactor/constraint/AutoConstraint;" />
|
||||
<node id="7785665572546684164" at="51,0,54,0" concept="5" trace="asAutoConstraint#()Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;" />
|
||||
<node id="7785665572546396680" at="55,0,58,0" concept="5" trace="registerHandler#(Ljetbrains/mps/logic/reactor/constraint/ComputingSession;Ljetbrains/mps/logic/reactor/constraint/Instructible;)V" />
|
||||
<node id="7785665572546293513" at="65,35,68,5" concept="4" />
|
||||
<node id="7785665572546293519" at="68,5,71,5" concept="4" />
|
||||
|
|
@ -238,7 +329,7 @@
|
|||
<scope id="5217246026233026719" at="38,55,39,25" />
|
||||
<scope id="7785665572546318125" at="43,28,44,18" />
|
||||
<scope id="7785665572546678503" at="47,36,48,29" />
|
||||
<scope id="7785665572546684167" at="51,44,52,33" />
|
||||
<scope id="7785665572546684167" at="51,47,52,36" />
|
||||
<scope id="7785665572546396684" at="55,87,56,58" />
|
||||
<scope id="7785665572546293514" at="66,20,67,18" />
|
||||
<scope id="7785665572546293520" at="69,55,70,19" />
|
||||
|
|
@ -299,7 +390,7 @@
|
|||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:2a79c8aa-e372-4c00-8d71-5d7f3db517e4(jetbrains.mps.logic.reactor.constraint)/7785665572546359770">
|
||||
<file name="AutoConstraint.java">
|
||||
<file name="BuiltinConstraint.java">
|
||||
<node id="7785665572546359898" at="11,0,12,0" concept="5" trace="solver#(Ljetbrains/mps/logic/reactor/constraint/ComputingSession;)Ljetbrains/mps/logic/reactor/constraint/Queryable;" />
|
||||
<node id="5217246026231400236" at="13,0,14,0" concept="5" trace="solverClass#()Ljava/lang/Class;" />
|
||||
<node id="7785665572546360338" at="15,0,16,0" concept="5" trace="symbol#()Ljava/lang/String;" />
|
||||
|
|
@ -310,7 +401,7 @@
|
|||
<scope id="5217246026231400236" at="13,0,14,0" />
|
||||
<scope id="7785665572546360338" at="15,0,16,0" />
|
||||
<scope id="7785665572546360681" at="17,0,18,0" />
|
||||
<unit id="7785665572546359770" at="9,0,20,0" name="jetbrains.mps.logic.reactor.constraint.AutoConstraint" />
|
||||
<unit id="7785665572546359770" at="9,0,20,0" name="jetbrains.mps.logic.reactor.constraint.BuiltinConstraint" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:2a79c8aa-e372-4c00-8d71-5d7f3db517e4(jetbrains.mps.logic.reactor.constraint)/7785665572546627183">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
package jetbrains.mps.logic.reactor.rule;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
import jetbrains.mps.logic.reactor.constraint.BuiltinConstraint;
|
||||
import jetbrains.mps.logic.reactor.constraint.ConstraintSymbol;
|
||||
import jetbrains.mps.logic.reactor.constraint.occurrence.AbstractConstraintOccurrence;
|
||||
import jetbrains.mps.logic.reactor.constraint.occurrence.InvalidConstraintException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
public abstract class ConstraintRegistry {
|
||||
|
||||
public abstract BuiltinConstraint findBuiltinConstraint(ConstraintSymbol symbol);
|
||||
|
||||
public void checkValidConstraint(AbstractConstraintOccurrence cst) throws InvalidConstraintException {
|
||||
switch (cst.kind()) {
|
||||
case USER:
|
||||
boolean matches = cst.symbol().arity() == cst.arguments().size();
|
||||
if (!(matches)) {
|
||||
throw new InvalidConstraintException("arity mismatch for " + String.valueOf(cst.symbol()));
|
||||
}
|
||||
|
||||
if (userConstraintArgTypes.containsKey(cst.symbol())) {
|
||||
if (!(Arrays.equals(argType(cst), userConstraintArgTypes.get(cst.symbol())))) {
|
||||
throw new InvalidConstraintException("argument type mismatch for " + String.valueOf(cst.symbol()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BUILTIN:
|
||||
if (cst.arguments().size() != cst.symbol().arity()) {
|
||||
throw new InvalidConstraintException("arity mismatch for " + String.valueOf(cst.symbol()));
|
||||
}
|
||||
break;
|
||||
|
||||
case JAVA:
|
||||
// FIXME: implement me
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
for (Object arg : cst.arguments()) {
|
||||
if (arg == null) {
|
||||
throw new InvalidConstraintException("argument is null in " + String.valueOf(cst.symbol()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Set<ConstraintSymbol> constraintSymbols() {
|
||||
return Collections.unmodifiableSet(userConstraintArgTypes.keySet());
|
||||
}
|
||||
|
||||
public Set<ConstraintSymbol> builtinConstraintSymbols() {
|
||||
return Collections.unmodifiableSet(builtinSymbols);
|
||||
}
|
||||
|
||||
public Class<?>[] getUserConstraintArgTypes(Object id) {
|
||||
if (!(userConstraintArgTypes.containsKey(id))) {
|
||||
throw new IllegalArgumentException("no such ID: " + id);
|
||||
}
|
||||
return userConstraintArgTypes.get(id);
|
||||
}
|
||||
|
||||
public void introduceConstraint(AbstractConstraintOccurrence cst) throws InvalidConstraintException {
|
||||
checkValidConstraint(cst);
|
||||
switch (cst.kind()) {
|
||||
case USER:
|
||||
userConstraintArgTypes.put(cst.symbol(), argType(cst));
|
||||
break;
|
||||
|
||||
case LOGICAL:
|
||||
// fall through
|
||||
case BUILTIN:
|
||||
builtinSymbols.add(cst.symbol());
|
||||
break;
|
||||
|
||||
case JAVA:
|
||||
// FIXME implement me
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new IllegalArgumentException("unknown constraint kind '" + cst.kind() + "'");
|
||||
}
|
||||
}
|
||||
|
||||
private Class<?>[] argType(AbstractConstraintOccurrence cst) {
|
||||
Class<?>[] argType = new Class<?>[cst.arguments().size()];
|
||||
int i = 0;
|
||||
for (Object arg : cst.arguments()) {
|
||||
if (arg != null) {
|
||||
argType[i++] = arg.getClass();
|
||||
}
|
||||
}
|
||||
return argType;
|
||||
}
|
||||
|
||||
private Set<ConstraintSymbol> builtinSymbols = new HashSet<ConstraintSymbol>();
|
||||
|
||||
private Map<ConstraintSymbol, Class<?>[]> userConstraintArgTypes = new HashMap<ConstraintSymbol, Class<?>[]>();
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package jetbrains.mps.logic.reactor.rule;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
|
||||
public class InvalidRuleException extends Exception {
|
||||
|
||||
public InvalidRuleException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public InvalidRuleException(String message, Throwable throwable) {
|
||||
super(message, throwable);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package jetbrains.mps.logic.reactor.rule;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
import jetbrains.mps.logic.reactor.constraint.occurrence.ConstraintOccurrence;
|
||||
import jetbrains.mps.logic.reactor.constraint.occurrence.AbstractConstraintOccurrence;
|
||||
|
||||
public abstract class Rule {
|
||||
|
||||
public abstract Rule.Kind kind();
|
||||
|
||||
public abstract String tag();
|
||||
|
||||
public abstract Iterable<ConstraintOccurrence> headKept();
|
||||
|
||||
public abstract Iterable<ConstraintOccurrence> headReplaced();
|
||||
|
||||
public abstract Iterable<AbstractConstraintOccurrence> guard();
|
||||
|
||||
public abstract Iterable<AbstractConstraintOccurrence> body();
|
||||
|
||||
public abstract Iterable<AbstractConstraintOccurrence> all();
|
||||
|
||||
public static enum Kind {
|
||||
SIMPLIFICATION(),
|
||||
PROPAGATION(),
|
||||
SIMPAGATION();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
package jetbrains.mps.logic.reactor.rule;
|
||||
|
||||
/*Generated by MPS */
|
||||
|
||||
import jetbrains.mps.logic.reactor.constraint.occurrence.AbstractConstraintOccurrence;
|
||||
import jetbrains.mps.logic.reactor.constraint.occurrence.ConstraintOccurrence;
|
||||
import java.util.Collections;
|
||||
import com.google.common.collect.Iterables;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RuleBuilder {
|
||||
|
||||
public RuleBuilder(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public RuleBuilder appendBody(AbstractConstraintOccurrence... c) {
|
||||
for (int i = 0; i < c.length; i++) {
|
||||
body.add(c[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RuleBuilder appendGuard(AbstractConstraintOccurrence... c) {
|
||||
for (int i = 0; i < c.length; i++) {
|
||||
guard.add(c[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RuleBuilder appendHeadReplaced(ConstraintOccurrence... uc) {
|
||||
for (int i = 0; i < uc.length; i++) {
|
||||
headReplaced.add(uc[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RuleBuilder appendHeadKept(ConstraintOccurrence... uc) {
|
||||
for (int i = 0; i < uc.length; i++) {
|
||||
headKept.add(uc[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean hasHead() {
|
||||
return !((headKept.isEmpty() && headReplaced.isEmpty()));
|
||||
}
|
||||
|
||||
public boolean hasGuard() {
|
||||
return !(guard.isEmpty());
|
||||
}
|
||||
|
||||
public boolean hasBody() {
|
||||
return !(body.isEmpty());
|
||||
}
|
||||
|
||||
public RuleBuilder merge(RuleBuilder... other) {
|
||||
doMerge(other);
|
||||
return this;
|
||||
}
|
||||
|
||||
public jetbrains.mps.logic.reactor.rule.Rule toRule() throws InvalidRuleException {
|
||||
jetbrains.mps.logic.reactor.rule.Rule.Kind kind;
|
||||
if (!(headKept.isEmpty()) && !(headReplaced.isEmpty())) {
|
||||
kind = jetbrains.mps.logic.reactor.rule.Rule.Kind.SIMPAGATION;
|
||||
|
||||
} else if (!(headReplaced.isEmpty())) {
|
||||
kind = jetbrains.mps.logic.reactor.rule.Rule.Kind.SIMPLIFICATION;
|
||||
|
||||
} else if (!(headKept.isEmpty())) {
|
||||
kind = jetbrains.mps.logic.reactor.rule.Rule.Kind.PROPAGATION;
|
||||
|
||||
} else {
|
||||
throw new InvalidRuleException("Invalid rule: empty head in " + toString());
|
||||
}
|
||||
|
||||
if (body.isEmpty()) {
|
||||
throw new InvalidRuleException("Invalid rule: empty body in " + toString());
|
||||
}
|
||||
|
||||
headKept = Collections.unmodifiableList(headKept);
|
||||
headReplaced = Collections.unmodifiableList(headReplaced);
|
||||
guard = Collections.unmodifiableList(guard);
|
||||
body = Collections.unmodifiableList(body);
|
||||
|
||||
return new RuleBuilder.Rule(kind, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s (%d,%d,%d,%d)", tag, headKept.size(), headReplaced.size(), guard.size(), body.size());
|
||||
}
|
||||
|
||||
private void doMerge(RuleBuilder... other) {
|
||||
for (int i = 0; i < other.length; i++) {
|
||||
RuleBuilder toMerge = other[i];
|
||||
|
||||
headReplaced.addAll(toMerge.headReplaced);
|
||||
headKept.addAll(toMerge.headKept);
|
||||
guard.addAll(toMerge.guard);
|
||||
body.addAll(toMerge.body);
|
||||
}
|
||||
}
|
||||
|
||||
public class Rule extends jetbrains.mps.logic.reactor.rule.Rule {
|
||||
|
||||
private Rule(jetbrains.mps.logic.reactor.rule.Rule.Kind kind, String tag) {
|
||||
this.kind = kind;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public jetbrains.mps.logic.reactor.rule.Rule.Kind kind() {
|
||||
return kind;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String tag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<ConstraintOccurrence> headKept() {
|
||||
return headKept;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<ConstraintOccurrence> headReplaced() {
|
||||
return headReplaced;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AbstractConstraintOccurrence> guard() {
|
||||
return guard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AbstractConstraintOccurrence> body() {
|
||||
return body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AbstractConstraintOccurrence> all() {
|
||||
return Iterables.concat(headKept, headReplaced, guard, body);
|
||||
}
|
||||
|
||||
private jetbrains.mps.logic.reactor.rule.Rule.Kind kind;
|
||||
private String tag;
|
||||
}
|
||||
|
||||
private String tag;
|
||||
private List<ConstraintOccurrence> headKept = new ArrayList<ConstraintOccurrence>(4);
|
||||
private List<ConstraintOccurrence> headReplaced = new ArrayList<ConstraintOccurrence>(4);
|
||||
private List<AbstractConstraintOccurrence> guard = new ArrayList<AbstractConstraintOccurrence>(4);
|
||||
private List<AbstractConstraintOccurrence> body = new ArrayList<AbstractConstraintOccurrence>(4);
|
||||
}
|
||||
|
|
@ -0,0 +1,343 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<debug-info>
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.BlockStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.BreakStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ConstructorDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ExpressionStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.FieldDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ForStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ForeachStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.IfStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ReturnStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.SingleLineComment" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.Statement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.SuperConstructorInvocation" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.SwitchStatement" />
|
||||
<concept fqn="jetbrains.mps.baseLanguage.structure.ThrowStatement" />
|
||||
<root nodeRef="r:e8529b97-a186-4c32-8f12-771b2a92b55a(jetbrains.mps.logic.reactor.rule)/8335224865064895074">
|
||||
<file name="Rule.java">
|
||||
<node id="8335224865064895076" at="10,0,11,0" concept="8" trace="kind#()Ljetbrains/mps/logic/reactor/rule/Rule/Kind;" />
|
||||
<node id="7303011777414843895" at="12,0,13,0" concept="8" trace="tag#()Ljava/lang/String;" />
|
||||
<node id="8335224865064895081" at="14,0,15,0" concept="8" trace="headKept#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865064895087" at="16,0,17,0" concept="8" trace="headReplaced#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865064895093" at="18,0,19,0" concept="8" trace="guard#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865064895099" at="20,0,21,0" concept="8" trace="body#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865065122390" at="22,0,23,0" concept="8" trace="all#()Ljava/lang/Iterable;" />
|
||||
<scope id="8335224865064895076" at="10,0,11,0" />
|
||||
<scope id="7303011777414843895" at="12,0,13,0" />
|
||||
<scope id="8335224865064895081" at="14,0,15,0" />
|
||||
<scope id="8335224865064895087" at="16,0,17,0" />
|
||||
<scope id="8335224865064895093" at="18,0,19,0" />
|
||||
<scope id="8335224865064895099" at="20,0,21,0" />
|
||||
<scope id="8335224865065122390" at="22,0,23,0" />
|
||||
<unit id="8335224865064895106" at="24,0,30,0" name="jetbrains.mps.logic.reactor.rule.Rule$Kind" />
|
||||
<unit id="8335224865064895074" at="8,0,32,0" name="jetbrains.mps.logic.reactor.rule.Rule" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:e8529b97-a186-4c32-8f12-771b2a92b55a(jetbrains.mps.logic.reactor.rule)/8335224865064895129">
|
||||
<file name="RuleBuilder.java">
|
||||
<node id="7303011777414773402" at="14,34,15,19" concept="3" />
|
||||
<node id="8335224865064895145" at="19,40,20,21" concept="3" />
|
||||
<node id="8335224865064895162" at="21,5,22,16" concept="10" />
|
||||
<node id="8335224865064895174" at="26,40,27,22" concept="3" />
|
||||
<node id="8335224865064895191" at="28,5,29,16" concept="10" />
|
||||
<node id="8335224865064895200" at="33,41,34,30" concept="3" />
|
||||
<node id="8335224865064895217" at="35,5,36,16" concept="10" />
|
||||
<node id="8335224865064895229" at="40,41,41,26" concept="3" />
|
||||
<node id="8335224865064895246" at="42,5,43,16" concept="10" />
|
||||
<node id="8490564095238015565" at="46,28,47,61" concept="10" />
|
||||
<node id="8490564095238043833" at="50,29,51,30" concept="10" />
|
||||
<node id="8490564095238045470" at="54,28,55,29" concept="10" />
|
||||
<node id="2966490507992344509" at="58,50,59,19" concept="3" />
|
||||
<node id="8207393387016330175" at="59,19,60,16" concept="10" />
|
||||
<node id="8335224865064895256" at="63,85,64,52" concept="9" />
|
||||
<node id="8335224865064895261" at="65,61,66,68" concept="3" />
|
||||
<node id="4340821131296540362" at="66,68,67,0" concept="12" />
|
||||
<node id="8335224865064895276" at="68,43,69,71" concept="3" />
|
||||
<node id="4340821131296540379" at="69,71,70,0" concept="12" />
|
||||
<node id="8335224865064895290" at="71,39,72,68" concept="3" />
|
||||
<node id="4340821131296540396" at="72,68,73,0" concept="12" />
|
||||
<node id="8335224865064895296" at="74,12,75,82" concept="15" />
|
||||
<node id="8335224865064895300" at="76,5,77,0" concept="12" />
|
||||
<node id="8335224865064895303" at="78,25,79,82" concept="15" />
|
||||
<node id="8335224865064895310" at="80,5,81,0" concept="12" />
|
||||
<node id="8335224865064895311" at="81,0,82,54" concept="3" />
|
||||
<node id="8335224865064895316" at="82,54,83,62" concept="3" />
|
||||
<node id="8335224865064895321" at="83,62,84,48" concept="3" />
|
||||
<node id="8335224865064895326" at="84,48,85,46" concept="3" />
|
||||
<node id="8335224865064895331" at="85,46,86,0" concept="12" />
|
||||
<node id="8335224865064895332" at="86,0,87,43" concept="10" />
|
||||
<node id="4340821131296552508" at="91,28,92,115" concept="10" />
|
||||
<node id="2966490507992344455" at="96,44,97,37" concept="9" />
|
||||
<node id="2966490507992344461" at="97,37,98,0" concept="12" />
|
||||
<node id="2966490507992344462" at="98,0,99,48" concept="3" />
|
||||
<node id="2966490507992344469" at="99,48,100,40" concept="3" />
|
||||
<node id="2966490507992344476" at="100,40,101,34" concept="3" />
|
||||
<node id="2966490507992344483" at="101,34,102,32" concept="3" />
|
||||
<node id="8335224865064895343" at="108,79,109,23" concept="3" />
|
||||
<node id="7303011777414821015" at="109,23,110,21" concept="3" />
|
||||
<node id="8335224865064895356" at="113,62,114,18" concept="10" />
|
||||
<node id="7303011777414878706" at="118,25,119,17" concept="10" />
|
||||
<node id="8335224865064895366" at="123,54,124,22" concept="10" />
|
||||
<node id="8335224865064895374" at="128,58,129,26" concept="10" />
|
||||
<node id="8335224865064895382" at="133,59,134,19" concept="10" />
|
||||
<node id="8335224865064895390" at="138,58,139,18" concept="10" />
|
||||
<node id="8335224865065270680" at="143,57,144,67" concept="10" />
|
||||
<node id="8335224865064895393" at="147,0,148,0" concept="4" trace="kind" />
|
||||
<node id="7303011777414821011" at="148,0,149,0" concept="4" trace="tag" />
|
||||
<node id="7303011777414773398" at="151,0,152,0" concept="4" trace="tag" />
|
||||
<node id="8335224865064895397" at="152,0,153,0" concept="4" trace="headKept" />
|
||||
<node id="8335224865064895405" at="153,0,154,0" concept="4" trace="headReplaced" />
|
||||
<node id="8335224865064895413" at="154,0,155,0" concept="4" trace="guard" />
|
||||
<node id="8335224865064895421" at="155,0,156,0" concept="4" trace="body" />
|
||||
<node id="8335224865064895294" at="74,10,76,5" concept="0" />
|
||||
<node id="7303011777414747729" at="14,0,17,0" concept="2" trace="RuleBuilder#(Ljava/lang/String;)V" />
|
||||
<node id="8335224865064895143" at="18,68,21,5" concept="5" />
|
||||
<node id="8335224865064895172" at="25,69,28,5" concept="5" />
|
||||
<node id="8335224865064895198" at="32,69,35,5" concept="5" />
|
||||
<node id="8335224865064895227" at="39,65,42,5" concept="5" />
|
||||
<node id="8490564095237998215" at="46,0,49,0" concept="8" trace="hasHead#()Z" />
|
||||
<node id="8490564095238019402" at="50,0,53,0" concept="8" trace="hasGuard#()Z" />
|
||||
<node id="8490564095238045466" at="54,0,57,0" concept="8" trace="hasBody#()Z" />
|
||||
<node id="8335224865064895301" at="77,0,80,5" concept="7" />
|
||||
<node id="8335224865064895352" at="113,0,116,0" concept="8" trace="kind#()Ljetbrains/mps/logic/reactor/rule/Rule/Kind;" />
|
||||
<node id="8207393387016228023" at="58,0,62,0" concept="8" trace="merge#(null)Ljetbrains/mps/logic/reactor/rule/RuleBuilder;" />
|
||||
<node id="4340821131296548229" at="90,0,94,0" concept="8" trace="toString#()Ljava/lang/String;" />
|
||||
<node id="8335224865064895339" at="108,0,112,0" concept="2" trace="Rule#(Ljetbrains/mps/logic/reactor/rule/Rule/Kind;Ljava/lang/String;)V" />
|
||||
<node id="7303011777414858647" at="117,0,121,0" concept="8" trace="tag#()Ljava/lang/String;" />
|
||||
<node id="8335224865064895361" at="122,0,126,0" concept="8" trace="headKept#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865064895369" at="127,0,131,0" concept="8" trace="headReplaced#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865064895377" at="132,0,136,0" concept="8" trace="guard#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865064895385" at="137,0,141,0" concept="8" trace="body#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865065133958" at="142,0,146,0" concept="8" trace="all#()Ljava/lang/Iterable;" />
|
||||
<node id="8335224865064895136" at="18,0,24,0" concept="8" trace="appendBody#(null)Ljetbrains/mps/logic/reactor/rule/RuleBuilder;" />
|
||||
<node id="8335224865064895165" at="25,0,31,0" concept="8" trace="appendGuard#(null)Ljetbrains/mps/logic/reactor/rule/RuleBuilder;" />
|
||||
<node id="8335224865064895194" at="32,0,38,0" concept="8" trace="appendHeadReplaced#(null)Ljetbrains/mps/logic/reactor/rule/RuleBuilder;" />
|
||||
<node id="8335224865064895223" at="39,0,45,0" concept="8" trace="appendHeadKept#(null)Ljetbrains/mps/logic/reactor/rule/RuleBuilder;" />
|
||||
<node id="2966490507992344450" at="95,46,103,5" concept="5" />
|
||||
<node id="2966490507992344504" at="95,0,105,0" concept="8" trace="doMerge#(null)V" />
|
||||
<node id="8335224865064895259" at="64,52,76,5" concept="7" />
|
||||
<node id="8335224865064895252" at="63,0,89,0" concept="8" trace="toRule#()Ljetbrains/mps/logic/reactor/rule/Rule;" />
|
||||
<scope id="7303011777414747732" at="14,34,15,19" />
|
||||
<scope id="8335224865064895144" at="19,40,20,21" />
|
||||
<scope id="8335224865064895173" at="26,40,27,22" />
|
||||
<scope id="8335224865064895199" at="33,41,34,30" />
|
||||
<scope id="8335224865064895228" at="40,41,41,26" />
|
||||
<scope id="8490564095237998219" at="46,28,47,61" />
|
||||
<scope id="8490564095238019405" at="50,29,51,30" />
|
||||
<scope id="8490564095238045469" at="54,28,55,29" />
|
||||
<scope id="8335224865064895295" at="74,12,75,82" />
|
||||
<scope id="8335224865064895302" at="78,25,79,82" />
|
||||
<scope id="4340821131296548233" at="91,28,92,115" />
|
||||
<scope id="8335224865064895355" at="113,62,114,18" />
|
||||
<scope id="7303011777414858651" at="118,25,119,17" />
|
||||
<scope id="8335224865064895365" at="123,54,124,22" />
|
||||
<scope id="8335224865064895373" at="128,58,129,26" />
|
||||
<scope id="8335224865064895381" at="133,59,134,19" />
|
||||
<scope id="8335224865064895389" at="138,58,139,18" />
|
||||
<scope id="8335224865065133963" at="143,57,144,67" />
|
||||
<scope id="8207393387016228026" at="58,50,60,16" />
|
||||
<scope id="8335224865064895260" at="65,61,67,0" />
|
||||
<scope id="8335224865064895275" at="68,43,70,0" />
|
||||
<scope id="8335224865064895289" at="71,39,73,0" />
|
||||
<scope id="8335224865064895342" at="108,79,110,21" />
|
||||
<scope id="7303011777414747729" at="14,0,17,0">
|
||||
<var name="tag" id="7303011777414773101" />
|
||||
</scope>
|
||||
<scope id="8335224865064895143" at="18,68,21,5">
|
||||
<var name="i" id="8335224865064895152" />
|
||||
</scope>
|
||||
<scope id="8335224865064895172" at="25,69,28,5">
|
||||
<var name="i" id="8335224865064895181" />
|
||||
</scope>
|
||||
<scope id="8335224865064895198" at="32,69,35,5">
|
||||
<var name="i" id="8335224865064895207" />
|
||||
</scope>
|
||||
<scope id="8335224865064895227" at="39,65,42,5">
|
||||
<var name="i" id="8335224865064895236" />
|
||||
</scope>
|
||||
<scope id="8490564095237998215" at="46,0,49,0" />
|
||||
<scope id="8490564095238019402" at="50,0,53,0" />
|
||||
<scope id="8490564095238045466" at="54,0,57,0" />
|
||||
<scope id="8335224865064895352" at="113,0,116,0" />
|
||||
<scope id="8335224865064895142" at="18,68,22,16" />
|
||||
<scope id="8335224865064895171" at="25,69,29,16" />
|
||||
<scope id="8335224865064895197" at="32,69,36,16" />
|
||||
<scope id="8335224865064895226" at="39,65,43,16" />
|
||||
<scope id="8207393387016228023" at="58,0,62,0">
|
||||
<var name="other" id="8207393387016238232" />
|
||||
</scope>
|
||||
<scope id="4340821131296548229" at="90,0,94,0" />
|
||||
<scope id="8335224865064895339" at="108,0,112,0">
|
||||
<var name="kind" id="8335224865064895349" />
|
||||
<var name="tag" id="7303011777414819208" />
|
||||
</scope>
|
||||
<scope id="7303011777414858647" at="117,0,121,0" />
|
||||
<scope id="8335224865064895361" at="122,0,126,0" />
|
||||
<scope id="8335224865064895369" at="127,0,131,0" />
|
||||
<scope id="8335224865064895377" at="132,0,136,0" />
|
||||
<scope id="8335224865064895385" at="137,0,141,0" />
|
||||
<scope id="8335224865065133958" at="142,0,146,0" />
|
||||
<scope id="8335224865064895136" at="18,0,24,0">
|
||||
<var name="c" id="8335224865064895137" />
|
||||
</scope>
|
||||
<scope id="8335224865064895165" at="25,0,31,0">
|
||||
<var name="c" id="8335224865064895166" />
|
||||
</scope>
|
||||
<scope id="8335224865064895194" at="32,0,38,0">
|
||||
<var name="uc" id="8335224865064895219" />
|
||||
</scope>
|
||||
<scope id="8335224865064895223" at="39,0,45,0">
|
||||
<var name="uc" id="8335224865064895248" />
|
||||
</scope>
|
||||
<scope id="2966490507992344454" at="96,44,102,32">
|
||||
<var name="toMerge" id="2966490507992344456" />
|
||||
</scope>
|
||||
<scope id="2966490507992344449" at="95,46,103,5" />
|
||||
<scope id="2966490507992344450" at="95,46,103,5">
|
||||
<var name="i" id="2966490507992344451" />
|
||||
</scope>
|
||||
<scope id="2966490507992344504" at="95,0,105,0">
|
||||
<var name="other" id="2966490507992344497" />
|
||||
</scope>
|
||||
<scope id="8335224865064895255" at="63,85,87,43">
|
||||
<var name="kind" id="8335224865064895257" />
|
||||
</scope>
|
||||
<scope id="8335224865064895252" at="63,0,89,0" />
|
||||
<unit id="8335224865064895337" at="106,0,150,0" name="jetbrains.mps.logic.reactor.rule.RuleBuilder$Rule" />
|
||||
<unit id="8335224865064895129" at="12,0,157,0" name="jetbrains.mps.logic.reactor.rule.RuleBuilder" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:e8529b97-a186-4c32-8f12-771b2a92b55a(jetbrains.mps.logic.reactor.rule)/8335224865065076751">
|
||||
<file name="ConstraintRegistry.java">
|
||||
<node id="2765114335962821805" at="18,0,19,0" concept="8" trace="findBuiltinConstraint#(Ljetbrains/mps/logic/reactor/constraint/ConstraintSymbol;)Ljetbrains/mps/logic/reactor/constraint/BuiltinConstraint;" />
|
||||
<node id="8335224865065811447" at="22,16,23,73" concept="9" />
|
||||
<node id="9010599623176703352" at="24,25,25,101" concept="15" />
|
||||
<node id="1797788903619179849" at="26,9,27,0" concept="12" />
|
||||
<node id="1797788903619179688" at="29,89,30,111" concept="15" />
|
||||
<node id="2784663291560052681" at="32,9,33,14" concept="1" />
|
||||
<node id="2784663291560571748" at="33,14,34,0" concept="12" />
|
||||
<node id="2765114335964085288" at="36,61,37,101" concept="15" />
|
||||
<node id="2784663291560058699" at="38,9,39,14" concept="1" />
|
||||
<node id="2784663291560570856" at="39,14,40,0" concept="12" />
|
||||
<node id="2784663291560059479" at="41,16,42,31" concept="11" />
|
||||
<node id="2784663291560565418" at="42,31,43,14" concept="1" />
|
||||
<node id="2784663291560570366" at="43,14,44,0" concept="12" />
|
||||
<node id="3187386103832393156" at="46,5,47,0" concept="12" />
|
||||
<node id="3187386103832401855" at="49,24,50,100" concept="15" />
|
||||
<node id="1142503322777751353" at="55,52,56,72" concept="10" />
|
||||
<node id="2765114335964299712" at="59,59,60,55" concept="10" />
|
||||
<node id="1142503322777775829" at="64,52,65,62" concept="15" />
|
||||
<node id="1142503322777767764" at="66,5,67,42" concept="10" />
|
||||
<node id="9010599623176721663" at="70,103,71,30" concept="3" />
|
||||
<node id="8335224865065495094" at="73,16,74,63" concept="3" />
|
||||
<node id="2784663291560018285" at="74,63,75,14" concept="1" />
|
||||
<node id="2784663291560586359" at="75,14,76,0" concept="12" />
|
||||
<node id="5841747851379990231" at="77,19,78,24" concept="11" />
|
||||
<node id="2765114335964240512" at="79,19,80,41" concept="3" />
|
||||
<node id="2784663291560026199" at="80,41,81,14" concept="1" />
|
||||
<node id="5841747851379471379" at="81,14,82,0" concept="12" />
|
||||
<node id="2784663291560027749" at="83,16,84,30" concept="11" />
|
||||
<node id="2784663291560589740" at="84,30,85,14" concept="1" />
|
||||
<node id="2784663291560589940" at="85,14,86,0" concept="12" />
|
||||
<node id="5841747851379458889" at="87,14,88,91" concept="15" />
|
||||
<node id="1797788903619105195" at="92,64,93,62" concept="9" />
|
||||
<node id="1797788903619105210" at="93,62,94,14" concept="9" />
|
||||
<node id="1797788903619105216" at="96,24,97,38" concept="3" />
|
||||
<node id="1797788903619105230" at="99,5,100,19" concept="10" />
|
||||
<node id="2765114335964095376" at="103,0,104,0" concept="4" trace="builtinSymbols" />
|
||||
<node id="8335224865065410940" at="105,0,106,0" concept="4" trace="userConstraintArgTypes" />
|
||||
<node id="8335224865065815168" at="23,73,26,9" concept="7" />
|
||||
<node id="1797788903619160572" at="28,63,31,11" concept="7" />
|
||||
<node id="2765114335964050384" at="35,19,38,9" concept="7" />
|
||||
<node id="3187386103832401304" at="48,40,51,7" concept="7" />
|
||||
<node id="1142503322777740657" at="55,0,58,0" concept="8" trace="constraintSymbols#()Ljava/util/Set;" />
|
||||
<node id="2765114335964268407" at="59,0,62,0" concept="8" trace="builtinConstraintSymbols#()Ljava/util/Set;" />
|
||||
<node id="1142503322777772806" at="63,58,66,5" concept="7" />
|
||||
<node id="962069921701421856" at="95,40,98,7" concept="7" />
|
||||
<node id="8335224865065477009" at="27,0,32,9" concept="7" />
|
||||
<node id="3187386103832398869" at="47,0,52,5" concept="6" />
|
||||
<node id="1797788903619105214" at="94,14,99,5" concept="6" />
|
||||
<node id="1142503322777758852" at="63,0,69,0" concept="8" trace="getUserConstraintArgTypes#(Ljava/lang/Object;)[Ljava/lang/Class;" />
|
||||
<node id="1797788903619105242" at="92,0,102,0" concept="8" trace="argType#(Ljetbrains/mps/logic/reactor/constraint/occurrence/AbstractConstraintOccurrence;)[Ljava/lang/Class;" />
|
||||
<node id="2784663291559998093" at="71,30,89,5" concept="14" />
|
||||
<node id="8335224865065334794" at="70,0,91,0" concept="8" trace="introduceConstraint#(Ljetbrains/mps/logic/reactor/constraint/occurrence/AbstractConstraintOccurrence;)V" />
|
||||
<node id="2784663291560035682" at="20,104,46,5" concept="14" />
|
||||
<node id="8335224865065112275" at="20,0,54,0" concept="8" trace="checkValidConstraint#(Ljetbrains/mps/logic/reactor/constraint/occurrence/AbstractConstraintOccurrence;)V" />
|
||||
<scope id="2784663291560035684" at="45,14,45,14" />
|
||||
<scope id="2765114335962821805" at="18,0,19,0">
|
||||
<var name="symbol" id="2765114335962828124" />
|
||||
</scope>
|
||||
<scope id="8335224865065815171" at="24,25,25,101" />
|
||||
<scope id="1797788903619160574" at="29,89,30,111" />
|
||||
<scope id="2765114335964050385" at="36,61,37,101" />
|
||||
<scope id="3187386103832401305" at="49,24,50,100" />
|
||||
<scope id="1142503322777740661" at="55,52,56,72" />
|
||||
<scope id="2765114335964268411" at="59,59,60,55" />
|
||||
<scope id="1142503322777772809" at="64,52,65,62" />
|
||||
<scope id="5841747851379473349" at="77,19,78,24" />
|
||||
<scope id="2784663291559998095" at="87,14,88,91" />
|
||||
<scope id="962069921701421858" at="96,24,97,38" />
|
||||
<scope id="8335224865065477010" at="28,63,31,11" />
|
||||
<scope id="2784663291560044988" at="41,16,44,0" />
|
||||
<scope id="3187386103832398870" at="48,40,51,7" />
|
||||
<scope id="1142503322777740657" at="55,0,58,0" />
|
||||
<scope id="2765114335964268407" at="59,0,62,0" />
|
||||
<scope id="2784663291560004167" at="73,16,76,0" />
|
||||
<scope id="2784663291560008134" at="79,19,82,0" />
|
||||
<scope id="2784663291560010334" at="83,16,86,0" />
|
||||
<scope id="1797788903619105215" at="95,40,98,7" />
|
||||
<scope id="1142503322777758856" at="63,58,67,42" />
|
||||
<scope id="2784663291560042935" at="35,19,40,0" />
|
||||
<scope id="3187386103832398869" at="47,0,52,5">
|
||||
<var name="arg" id="3187386103832398873" />
|
||||
</scope>
|
||||
<scope id="1797788903619105214" at="94,14,99,5">
|
||||
<var name="arg" id="1797788903619105225" />
|
||||
</scope>
|
||||
<scope id="1142503322777758852" at="63,0,69,0">
|
||||
<var name="id" id="1142503322777766553" />
|
||||
</scope>
|
||||
<scope id="1797788903619105192" at="92,64,100,19">
|
||||
<var name="argType" id="1797788903619105196" />
|
||||
<var name="i" id="1797788903619105211" />
|
||||
</scope>
|
||||
<scope id="1797788903619105242" at="92,0,102,0">
|
||||
<var name="cst" id="1797788903619105232" />
|
||||
</scope>
|
||||
<scope id="2784663291560040546" at="22,16,34,0">
|
||||
<var name="matches" id="8335224865065811448" />
|
||||
</scope>
|
||||
<scope id="8335224865065334796" at="70,103,89,5" />
|
||||
<scope id="8335224865065334794" at="70,0,91,0">
|
||||
<var name="cst" id="8335224865065337066" />
|
||||
</scope>
|
||||
<scope id="8335224865065112279" at="20,104,52,5" />
|
||||
<scope id="8335224865065112275" at="20,0,54,0">
|
||||
<var name="cst" id="8335224865065112683" />
|
||||
</scope>
|
||||
<unit id="8335224865065076751" at="16,0,107,0" name="jetbrains.mps.logic.reactor.rule.ConstraintRegistry" />
|
||||
</file>
|
||||
</root>
|
||||
<root nodeRef="r:e8529b97-a186-4c32-8f12-771b2a92b55a(jetbrains.mps.logic.reactor.rule)/9010599623174261813">
|
||||
<file name="InvalidRuleException.java">
|
||||
<node id="9010599623174265602" at="8,47,9,19" concept="13" />
|
||||
<node id="9010599623174269829" at="12,68,13,30" concept="13" />
|
||||
<node id="9010599623174265548" at="8,0,11,0" concept="2" trace="InvalidRuleException#(Ljava/lang/String;)V" />
|
||||
<node id="9010599623174269823" at="12,0,15,0" concept="2" trace="InvalidRuleException#(Ljava/lang/String;Ljava/lang/Throwable;)V" />
|
||||
<scope id="9010599623174265552" at="8,47,9,19" />
|
||||
<scope id="9010599623174269828" at="12,68,13,30" />
|
||||
<scope id="9010599623174265548" at="8,0,11,0">
|
||||
<var name="message" id="9010599623174265564" />
|
||||
</scope>
|
||||
<scope id="9010599623174269823" at="12,0,15,0">
|
||||
<var name="message" id="9010599623174269824" />
|
||||
<var name="throwable" id="9010599623174270172" />
|
||||
</scope>
|
||||
<unit id="9010599623174261813" at="6,0,17,0" name="jetbrains.mps.logic.reactor.rule.InvalidRuleException" />
|
||||
</file>
|
||||
</root>
|
||||
</debug-info>
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package jetbrains.mps.logic.reactor.handler;
|
||||
|
||||
/**
|
||||
* @author Fedor Isakov
|
||||
*/
|
||||
public class RuleHandler {
|
||||
|
||||
public static Factory with() {
|
||||
return ourCompanion.createFactory();
|
||||
}
|
||||
|
||||
public interface Factory {
|
||||
RuleHandler newHandler();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* SPI
|
||||
*/
|
||||
protected interface Companion {
|
||||
Factory createFactory();
|
||||
}
|
||||
|
||||
protected static Companion ourCompanion;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||
<orderEntry type="module" module-name="API" />
|
||||
<orderEntry type="module" module-name="Bridge" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package jetbrains.mps.logicl.reactor.core
|
||||
|
||||
/**
|
||||
* @author Fedor Isakov
|
||||
*/
|
||||
|
||||
import jetbrains.mps.logic.reactor.handler.RuleHandler
|
||||
|
||||
class FactoryImpl : RuleHandler.Factory {
|
||||
override fun newHandler(): RuleHandler = HandlerImpl()
|
||||
}
|
||||
|
||||
class HandlerImpl : RuleHandler() {
|
||||
|
||||
fun init() {
|
||||
ourCompanion = object : Companion {
|
||||
override fun createFactory(): Factory = FactoryImpl()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue