From 90044e69c7f92e2d02040aba62fc23a415a38d2c Mon Sep 17 00:00:00 2001 From: Fedor Isakov Date: Mon, 5 Jun 2017 15:16:19 +0200 Subject: [PATCH] Update the copyright notice with the license. Remove obsolete artefacts and "generated" markings. --- reactor/.idea/copyright/Apache_2_0.xml | 6 + reactor/.idea/copyright/profiles_settings.xml | 6 +- reactor/.idea/scopes/source.xml | 3 + reactor/API/API.iml | 49 +- .../reactor/evaluation/AbstractSolver.java | 17 + .../evaluation/ConstraintOccurrence.java | 19 +- .../EvaluationFailureException.java | 32 +- .../reactor/evaluation/EvaluationSession.java | 94 ++-- .../reactor/evaluation/EvaluationTrace.java | 116 +++-- .../reactor/evaluation/Instructible.java | 19 +- .../logic/reactor/evaluation/MatchRule.java | 25 +- .../evaluation/PredicateInvocation.java | 21 +- .../logic/reactor/evaluation/Queryable.java | 19 +- .../reactor/evaluation/SessionSolver.java | 26 +- .../logic/reactor/evaluation/StoreView.java | 18 + .../mps/logic/reactor/evaluation/trace.info | 441 ------------------ .../reactor/logical/JoinableLogical.java | 64 ++- .../mps/logic/reactor/logical/Logical.java | 62 ++- .../logic/reactor/logical/LogicalContext.java | 21 +- .../logic/reactor/logical/LogicalOwner.java | 22 +- .../logic/reactor/logical/MetaLogical.java | 76 +-- .../reactor/logical/MultiMetaLogical.java | 74 +-- .../mps/logic/reactor/logical/trace.info | 173 ------- .../mps/logic/reactor/program/AndItem.java | 25 +- .../mps/logic/reactor/program/Constraint.java | 38 +- .../reactor/program/ConstraintSymbol.java | 42 +- .../mps/logic/reactor/program/Handler.java | 24 +- .../program/InvalidConstraintException.java | 29 +- .../reactor/program/InvalidRuleException.java | 30 +- .../reactor/program/JavaPredicateSymbol.java | 47 +- .../mps/logic/reactor/program/Predicate.java | 28 +- .../reactor/program/PredicateSymbol.java | 37 +- .../mps/logic/reactor/program/Program.java | 21 +- .../mps/logic/reactor/program/Rule.java | 48 +- .../mps/logic/reactor/program/Symbol.java | 94 ++-- .../mps/logic/reactor/program/trace.info | 254 ---------- reactor/Core/Core.iml | 49 +- .../mps/logic/reactor/core/Controller.kt | 16 + .../reactor/core/EvaluationSessionImpl.kt | 16 + .../jetbrains/mps/logic/reactor/core/Frame.kt | 16 + .../mps/logic/reactor/core/Invocation.kt | 16 + .../mps/logic/reactor/core/Logical.kt | 15 + .../mps/logic/reactor/core/MatchTrie.kt | 16 + .../mps/logic/reactor/core/Matcher.kt | 16 + .../mps/logic/reactor/core/Occurrence.kt | 16 + .../mps/logic/reactor/core/PartialMatch.kt | 16 + .../logic/reactor/core/PropagationHistory.kt | 16 + .../mps/logic/reactor/core/RuleIndex.kt | 16 + .../jetbrains/mps/logic/reactor/core/Store.kt | 16 + .../mps/logic/reactor/core/TermImpl.kt | 16 + .../mps/logic/reactor/core/TermTrie.kt | 16 + .../mps/logic/reactor/util/DexxCollections.kt | 16 + .../mps/logic/reactor/util/IdHashSet.kt | 16 + .../mps/logic/reactor/util/IdWrapper.kt | 16 + .../mps/logic/reactor/util/Iterables.kt | 16 + .../mps/logic/reactor/util/Profiler.kt | 16 + .../mps/unification/Substitution.java | 2 +- .../src/jetbrains/mps/unification/Term.java | 2 +- .../mps/unification/TermWrapper.java | 16 + .../mps/unification/Unification.java | 2 +- .../UnionFindTermGraphUnifier.java | 2 +- reactor/Reactor.iml | 49 +- reactor/Test/Test.iml | 49 +- 63 files changed, 1233 insertions(+), 1361 deletions(-) create mode 100644 reactor/.idea/copyright/Apache_2_0.xml create mode 100644 reactor/.idea/scopes/source.xml delete mode 100644 reactor/API/src/jetbrains/mps/logic/reactor/evaluation/trace.info delete mode 100644 reactor/API/src/jetbrains/mps/logic/reactor/logical/trace.info delete mode 100644 reactor/API/src/jetbrains/mps/logic/reactor/program/trace.info diff --git a/reactor/.idea/copyright/Apache_2_0.xml b/reactor/.idea/copyright/Apache_2_0.xml new file mode 100644 index 00000000..f47c2c3d --- /dev/null +++ b/reactor/.idea/copyright/Apache_2_0.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/reactor/.idea/copyright/profiles_settings.xml b/reactor/.idea/copyright/profiles_settings.xml index e7bedf33..87af87ca 100644 --- a/reactor/.idea/copyright/profiles_settings.xml +++ b/reactor/.idea/copyright/profiles_settings.xml @@ -1,3 +1,7 @@ - + + + + + \ No newline at end of file diff --git a/reactor/.idea/scopes/source.xml b/reactor/.idea/scopes/source.xml new file mode 100644 index 00000000..91e8ffd3 --- /dev/null +++ b/reactor/.idea/scopes/source.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/reactor/API/API.iml b/reactor/API/API.iml index 74db282d..36a86c2b 100644 --- a/reactor/API/API.iml +++ b/reactor/API/API.iml @@ -2,41 +2,20 @@ - - - + + + + + + diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/AbstractSolver.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/AbstractSolver.java index 54aa46fc..cb89b852 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/AbstractSolver.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/AbstractSolver.java @@ -1,8 +1,25 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; /** * Not very useful now. * Serves as an abstract superclass for implementations, as a mixin of Instructible and Queryable. + * * @author Fedor Isakov */ public abstract class AbstractSolver implements Instructible, Queryable { diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/ConstraintOccurrence.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/ConstraintOccurrence.java index 8a7d2f09..cf96f48b 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/ConstraintOccurrence.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/ConstraintOccurrence.java @@ -1,6 +1,21 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; -/*Generated by MPS */ import jetbrains.mps.logic.reactor.logical.LogicalContext; import jetbrains.mps.logic.reactor.program.Constraint; @@ -9,6 +24,8 @@ import java.util.List; /** * Represents a run-time object corresponding to an actual constraint. + * + * @author Fedor Isakov */ public interface ConstraintOccurrence { diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationFailureException.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationFailureException.java index 4ea1a3e0..0743133e 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationFailureException.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationFailureException.java @@ -1,19 +1,35 @@ -package jetbrains.mps.logic.reactor.evaluation; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.evaluation; /** * Thrown in case evaluation fails. + * + * @author Fedor Isakov */ public class EvaluationFailureException extends RuntimeException { - public EvaluationFailureException(String message) { - super(message); - } + public EvaluationFailureException(String message) { + super(message); + } - public EvaluationFailureException(Throwable cause) { - super(cause); - } + public EvaluationFailureException(Throwable cause) { + super(cause); + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationSession.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationSession.java index dfd3d6fb..35b5345c 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationSession.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationSession.java @@ -1,21 +1,41 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; -/*Generated by MPS */ import jetbrains.mps.logic.reactor.logical.LogicalContext; -import jetbrains.mps.logic.reactor.program.*; - -import java.util.List; +import jetbrains.mps.logic.reactor.program.Constraint; +import jetbrains.mps.logic.reactor.program.Predicate; +import jetbrains.mps.logic.reactor.program.PredicateSymbol; +import jetbrains.mps.logic.reactor.program.Program; /** * The starting point to evaluate a program. - * + *

* The session is started with {@code newSession}, provided the backend has been initialized. - * + *

* The backend is supposed to be provided at startup. + * + * @author Fedor Isakov */ public abstract class EvaluationSession { + private static EvaluationSession.Backend ourBackend; + public static EvaluationSession current() { if (ourBackend == null) { throw new IllegalStateException("no backend"); @@ -30,6 +50,36 @@ public abstract class EvaluationSession { return ourBackend.createConfig(program); } + protected static void setBackend(EvaluationSession.Backend backend) { + if (ourBackend != null) { + throw new IllegalStateException("backend already assigned"); + } + ourBackend = backend; + } + + protected static void clearBackend(EvaluationSession.Backend backend) { + if (ourBackend != backend) { + throw new IllegalStateException("illegal access"); + } + ourBackend = null; + } + + public abstract SessionSolver sessionSolver(); + + public abstract StoreView storeView(); + + public abstract PredicateInvocation invocation(Predicate predicate, LogicalContext logicalContext); + + public abstract ConstraintOccurrence occurrence(Constraint constraint, LogicalContext logicalContext); + + protected interface Backend { + + EvaluationSession current(); + + EvaluationSession.Config createConfig(Program program); + + } + public static abstract class Config { public abstract EvaluationSession.Config withPredicates(PredicateSymbol... predicateSymbols); @@ -44,36 +94,4 @@ public abstract class EvaluationSession { } - public abstract SessionSolver sessionSolver(); - - public abstract StoreView storeView(); - - public abstract PredicateInvocation invocation(Predicate predicate, LogicalContext logicalContext); - - public abstract ConstraintOccurrence occurrence(Constraint constraint, LogicalContext logicalContext); - - protected static void setBackend(EvaluationSession.Backend backend) { - if (ourBackend != null) { - throw new IllegalStateException("backend already assigned"); - } - ourBackend = backend; - } - - protected static void clearBackend(EvaluationSession.Backend backend) { - if (ourBackend != backend) { - throw new IllegalStateException("illegal access"); - } - ourBackend = null; - } - - protected interface Backend { - - EvaluationSession current(); - - EvaluationSession.Config createConfig(Program program); - - } - - private static EvaluationSession.Backend ourBackend; - } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationTrace.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationTrace.java index 6afd394c..218381ca 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationTrace.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/EvaluationTrace.java @@ -1,68 +1,96 @@ -package jetbrains.mps.logic.reactor.evaluation; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.evaluation; /** * An interface to be implemented by clients wishing to be notified of the events during evaluation. + * + * @author Fedor Isakov */ public interface EvaluationTrace { - void activate(ConstraintOccurrence occurrence); + EvaluationTrace NULL = new EvaluationTrace() { - void reactivate(ConstraintOccurrence occurrence); + public void activate(ConstraintOccurrence occurrence) { + } - void suspend(ConstraintOccurrence occurrence); + public void reactivate(ConstraintOccurrence occurrence) { + } - void discard(ConstraintOccurrence occurrence); + public void suspend(ConstraintOccurrence occurrence) { + } - void trying(MatchRule matchRule); + public void discard(ConstraintOccurrence occurrence) { + } - void reject(MatchRule matchRule); + public void trying(MatchRule matchRule) { + } - void trigger(MatchRule matchRule); + public void reject(MatchRule matchRule) { + } - void retry(MatchRule matchRule); + public void trigger(MatchRule matchRule) { + } - void finish(MatchRule matchRule); + public void retry(MatchRule matchRule) { + } - void tell(PredicateInvocation invocation); + public void finish(MatchRule matchRule) { + } - void ask(boolean result, PredicateInvocation invocation); + public void tell(PredicateInvocation invocation) { + } - void failure(EvaluationFailureException fail); + public void ask(boolean result, PredicateInvocation invocation) { + } - @Deprecated - void reportFailure(String message); + public void failure(EvaluationFailureException fail) { + } - EvaluationTrace NULL = new EvaluationTrace() { + public void reportFailure(String message) { + } - public void activate(ConstraintOccurrence occurrence) { - } - public void reactivate(ConstraintOccurrence occurrence) { - } - public void suspend(ConstraintOccurrence occurrence) { - } - public void discard(ConstraintOccurrence occurrence) { - } - public void trying(MatchRule matchRule) { - } - public void reject(MatchRule matchRule) { - } - public void trigger(MatchRule matchRule) { - } - public void retry(MatchRule matchRule) { - } - public void finish(MatchRule matchRule) { - } - public void tell(PredicateInvocation invocation) { - } - public void ask(boolean result, PredicateInvocation invocation) { - } - public void failure(EvaluationFailureException fail) { - } - public void reportFailure(String message) { - } + }; - }; + void activate(ConstraintOccurrence occurrence); + + void reactivate(ConstraintOccurrence occurrence); + + void suspend(ConstraintOccurrence occurrence); + + void discard(ConstraintOccurrence occurrence); + + void trying(MatchRule matchRule); + + void reject(MatchRule matchRule); + + void trigger(MatchRule matchRule); + + void retry(MatchRule matchRule); + + void finish(MatchRule matchRule); + + void tell(PredicateInvocation invocation); + + void ask(boolean result, PredicateInvocation invocation); + + void failure(EvaluationFailureException fail); + + @Deprecated + void reportFailure(String message); } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/Instructible.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/Instructible.java index ba09a5f0..d2d4ad66 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/Instructible.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/Instructible.java @@ -1,9 +1,26 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; -/*Generated by MPS */ /** * Abstract interface to a predicate. + * + * @author Fedor Isakov */ public interface Instructible { diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/MatchRule.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/MatchRule.java index 541c3305..deacffb1 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/MatchRule.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/MatchRule.java @@ -1,18 +1,35 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; -/*Generated by MPS */ import jetbrains.mps.logic.reactor.program.Rule; /** * A binding of a rule and the constraints that matched its head. + * + * @author Fedor Isakov */ public interface MatchRule { - Rule rule(); + Rule rule(); - Iterable matchHeadKept(); + Iterable matchHeadKept(); - Iterable matchHeadReplaced(); + Iterable matchHeadReplaced(); } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/PredicateInvocation.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/PredicateInvocation.java index fd3a37ea..1b0def4b 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/PredicateInvocation.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/PredicateInvocation.java @@ -1,6 +1,21 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; -/*Generated by MPS */ import jetbrains.mps.logic.reactor.logical.LogicalContext; import jetbrains.mps.logic.reactor.program.Predicate; @@ -8,7 +23,9 @@ import jetbrains.mps.logic.reactor.program.Predicate; import java.util.List; /** - * A run-time object representing invocation of a predicate. + * A run-time object representing invocation of a predicate. + * + * @author Fedor Isakov */ public interface PredicateInvocation { diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/Queryable.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/Queryable.java index 9ebbb80e..85482933 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/Queryable.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/Queryable.java @@ -1,9 +1,26 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; -/*Generated by MPS */ /** * Abstract interface to a predicate. + * + * @author Fedor Isakov */ public interface Queryable extends Instructible { diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/SessionSolver.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/SessionSolver.java index a557fc83..ba0ed3d7 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/SessionSolver.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/SessionSolver.java @@ -1,6 +1,21 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; -/*Generated by MPS */ import jetbrains.mps.logic.reactor.logical.LogicalContext; import jetbrains.mps.logic.reactor.program.AndItem; @@ -12,9 +27,14 @@ import java.util.Map; /** * Is used to provide an interface for handlers and solvers working together in a single session. + * + * @author Fedor Isakov */ public abstract class SessionSolver implements Queryable, Instructible { + private Map solvers = new HashMap(); + private EvaluationTrace tracer = EvaluationTrace.NULL; + public void init(PredicateSymbol... predicateSymbols) { registerSymbols(predicateSymbols); } @@ -72,8 +92,4 @@ public abstract class SessionSolver implements Queryable, Instructible { } } - private Map solvers = new HashMap(); - - private EvaluationTrace tracer = EvaluationTrace.NULL; - } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/StoreView.java b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/StoreView.java index 52462756..701758f8 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/StoreView.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/StoreView.java @@ -1,9 +1,27 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.evaluation; import jetbrains.mps.logic.reactor.program.ConstraintSymbol; /** * A read-only view on the constraints store. + * + * @author Fedor Isakov */ public interface StoreView { diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/trace.info b/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/trace.info deleted file mode 100644 index a80ab951..00000000 --- a/reactor/API/src/jetbrains/mps/logic/reactor/evaluation/trace.info +++ /dev/null @@ -1,441 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/logical/JoinableLogical.java b/reactor/API/src/jetbrains/mps/logic/reactor/logical/JoinableLogical.java index 184be403..3db39328 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/logical/JoinableLogical.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/logical/JoinableLogical.java @@ -1,42 +1,58 @@ -package jetbrains.mps.logic.reactor.logical; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.logical; /** * A logical variable that can be joined with another variable to produce a union. * * @param the value type + * + * @author Fedor Isakov */ public interface JoinableLogical extends Logical { - /** - * Covariant override. - */ - JoinableLogical findRoot(); + /** + * Covariant override. + */ + JoinableLogical findRoot(); - /** - * Unions two equivalence classes of logicals. - * Both the receiver and the {@code other} parameter are expected to be representatives. - * The one with the highest rank becomes the representative for the new class. - */ - void union(JoinableLogical other, JoinableLogical.ValueReconciler reconciler); + /** + * Unions two equivalence classes of logicals. + * Both the receiver and the {@code other} parameter are expected to be representatives. + * The one with the highest rank becomes the representative for the new class. + */ + void union(JoinableLogical other, JoinableLogical.ValueReconciler reconciler); - /** - * Calls {@link JoinableLogical#union(JoinableLogical , JoinableLogical.ValueReconciler) } with the default value reconciler. - * The default reconciler throws {@link java.lang.IllegalArgumentException } if the two values are not equal. - */ - void union(JoinableLogical other); + /** + * Calls {@link JoinableLogical#union(JoinableLogical , JoinableLogical.ValueReconciler) } with the default value reconciler. + * The default reconciler throws {@link java.lang.IllegalArgumentException } if the two values are not equal. + */ + void union(JoinableLogical other); - /** - * Should only be called on a representative. - */ - void setValue(T newValue); + /** + * Should only be called on a representative. + */ + void setValue(T newValue); - interface ValueReconciler { + interface ValueReconciler { - void reconcile(T valueA, T valueB); + void reconcile(T valueA, T valueB); - } + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/logical/Logical.java b/reactor/API/src/jetbrains/mps/logic/reactor/logical/Logical.java index 59176467..524910a5 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/logical/Logical.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/logical/Logical.java @@ -1,40 +1,56 @@ -package jetbrains.mps.logic.reactor.logical; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.logical; /** * A run-time representation of a logical variable. * * @param the value type + * + * @author Fedor Isakov */ public interface Logical { - String name(); + String name(); - /** - * Returns the representative logical instance. - * - * TODO: rename to 'find()' - */ - Logical findRoot(); + /** + * Returns the representative logical instance. + *

+ * TODO: rename to 'find()' + */ + Logical findRoot(); - /** - * Returns the value associated with this logical instance. - * Can be null. - * Only the logical instance that is a representative can have value that is not null. - * - * FIXME: must return the representative's value - */ - T value(); + /** + * Returns the value associated with this logical instance. + * Can be null. + * Only the logical instance that is a representative can have value that is not null. + *

+ * FIXME: must return the representative's value + */ + T value(); - /** - * True iff the representative has a non-null value. - */ - boolean isBound(); + /** + * True iff the representative has a non-null value. + */ + boolean isBound(); - boolean isWildcard(); + boolean isWildcard(); - MetaLogical metaLogical(); + MetaLogical metaLogical(); } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/logical/LogicalContext.java b/reactor/API/src/jetbrains/mps/logic/reactor/logical/LogicalContext.java index 547f7446..a6dbb094 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/logical/LogicalContext.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/logical/LogicalContext.java @@ -1,13 +1,30 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.logical; -/*Generated by MPS */ /** * Substitution of logicals for meta-logicals. + * + * @author Fedor Isakov */ public interface LogicalContext { - Logical variable(MetaLogical metaLogical); + Logical variable(MetaLogical metaLogical); } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/logical/LogicalOwner.java b/reactor/API/src/jetbrains/mps/logic/reactor/logical/LogicalOwner.java index 774b9587..793b0cdc 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/logical/LogicalOwner.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/logical/LogicalOwner.java @@ -1,13 +1,29 @@ -package jetbrains.mps.logic.reactor.logical; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.logical; /** * An abstract wrapper for a {@link Logical}. + * + * @author Fedor Isakov */ public interface LogicalOwner { - Logical logical(); + Logical logical(); } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/logical/MetaLogical.java b/reactor/API/src/jetbrains/mps/logic/reactor/logical/MetaLogical.java index 90225b64..899087b8 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/logical/MetaLogical.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/logical/MetaLogical.java @@ -1,46 +1,62 @@ -package jetbrains.mps.logic.reactor.logical; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.logical; /** - * A declaration of a logical variable. + * A declaration of a logical variable. + * * @param the value type + * + * @author Fedor Isakov */ public class MetaLogical { - private static final String WILDCARD = "_"; + private static final String WILDCARD = "_"; + private String name; + private Class type; + private boolean wildcard = false; - public MetaLogical(String name, Class type) { - this.name = name; - this.type = type; - } + public MetaLogical(String name, Class type) { + this.name = name; + this.type = type; + } - public MetaLogical(Class type) { - this.name = MetaLogical.WILDCARD + System.identityHashCode(this); - this.type = type; - this.wildcard = true; - } + public MetaLogical(Class type) { + this.name = MetaLogical.WILDCARD + System.identityHashCode(this); + this.type = type; + this.wildcard = true; + } - public String name() { - return name; - } + public String name() { + return name; + } - public boolean isWildcard() { - return wildcard; - } + public boolean isWildcard() { + return wildcard; + } - public Class type() { - return type; - } + public Class type() { + return type; + } - @Override - public String toString() { - return name; - } - - private String name; - private Class type; - private boolean wildcard = false; + @Override + public String toString() { + return name; + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/logical/MultiMetaLogical.java b/reactor/API/src/jetbrains/mps/logic/reactor/logical/MultiMetaLogical.java index 0371f112..0bb6f919 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/logical/MultiMetaLogical.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/logical/MultiMetaLogical.java @@ -1,41 +1,59 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.logical; -/*Generated by MPS */ -import java.util.List; import java.util.ArrayList; +import java.util.List; /** - * A declaration of a logical variable with index. - * @param + * A declaration of a logical variable with index. + * + * @param the value type + * + * @author Fedor Isakov */ public class MultiMetaLogical extends MetaLogical { - public MultiMetaLogical(String name, Class type, int cardinality) { - super(name, type); - this.cardinality = cardinality; - init(); - } + private int cardinality; + private List> metaLogicals = new ArrayList>(); - public int cardinality() { - return cardinality; - } - - public MetaLogical logicalAt(int idx) { - return metaLogicals.get(idx); - } - - public MetaLogical[] toArray() { - MetaLogical[] array = new MetaLogical[cardinality]; - return metaLogicals.toArray(array); - } - - private void init() { - for (int i = 0; i < cardinality; i++) { - metaLogicals.add(new MetaLogical(name() + "_" + (i + 1), type())); + public MultiMetaLogical(String name, Class type, int cardinality) { + super(name, type); + this.cardinality = cardinality; + init(); } - } - private int cardinality; - private List> metaLogicals = new ArrayList>(); + public int cardinality() { + return cardinality; + } + + public MetaLogical logicalAt(int idx) { + return metaLogicals.get(idx); + } + + public MetaLogical[] toArray() { + MetaLogical[] array = new MetaLogical[cardinality]; + return metaLogicals.toArray(array); + } + + private void init() { + for (int i = 0; i < cardinality; i++) { + metaLogicals.add(new MetaLogical(name() + "_" + (i + 1), type())); + } + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/logical/trace.info b/reactor/API/src/jetbrains/mps/logic/reactor/logical/trace.info deleted file mode 100644 index 8d13180e..00000000 --- a/reactor/API/src/jetbrains/mps/logic/reactor/logical/trace.info +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/AndItem.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/AndItem.java index 46e1fd71..f29483fc 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/AndItem.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/AndItem.java @@ -1,16 +1,33 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.program; -/*Generated by MPS */ import java.util.List; /** - * An abstract conjunct. + * An abstract conjunct. + * + * @author Fedor Isakov */ public interface AndItem { - Symbol symbol(); + Symbol symbol(); - List arguments(); + List arguments(); } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/Constraint.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/Constraint.java index 2bb1e348..53baa70e 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/Constraint.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/Constraint.java @@ -1,25 +1,41 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.program; -/*Generated by MPS */ -import java.util.List; import java.util.Collection; -import jetbrains.mps.logic.reactor.logical.LogicalContext; +import java.util.List; /** * A constraint provided by a handler. + * + * @author Fedor Isakov */ public interface Constraint extends AndItem { - ConstraintSymbol symbol(); + ConstraintSymbol symbol(); - List> argumentTypes(); + List> argumentTypes(); - /** - * Returns the collection of predicates that need to be applied after a successful match of this collection by a - * rule's head. - * This method only returns meaningful results for constraints that serve as patterns in a rule's head. - */ - Collection patternPredicates(Collection occurrenceArgs); + /** + * Returns the collection of predicates that need to be applied after a successful match of this collection by a + * rule's head. + * This method only returns meaningful results for constraints that serve as patterns in a rule's head. + */ + Collection patternPredicates(Collection occurrenceArgs); } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/ConstraintSymbol.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/ConstraintSymbol.java index c0e0a32d..c4f84849 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/ConstraintSymbol.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/ConstraintSymbol.java @@ -1,24 +1,40 @@ -package jetbrains.mps.logic.reactor.program; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.program; /** - * TODO: move to the constraint model + * A constraint symbol. + * + * @author Fedor Isakov */ public class ConstraintSymbol extends Symbol { - public static ConstraintSymbol symbol(String id, int arity) { - return new ConstraintSymbol(id, arity); - } + public ConstraintSymbol(String id, int arity) { + super(id, arity); + } - public ConstraintSymbol(String id, int arity) { - super(id, arity); - } + public static ConstraintSymbol symbol(String id, int arity) { + return new ConstraintSymbol(id, arity); + } - @Override - public String toString() { - return id() + "/" + arity(); - } + @Override + public String toString() { + return id() + "/" + arity(); + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/Handler.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/Handler.java index f00653ac..7dfffa25 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/Handler.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/Handler.java @@ -1,10 +1,28 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.program; /** - * A handler is a container of rules. + * A handler is a container of rules. + *

+ * If the {@code primarySymbols} is a non-empty collection, only constraints with these symbols are processed + * by this handler. * - * If the {@code primarySymbols} is a non-empty collection, only constraints with these symbols are processed - * by this handler. + * @author Fedor Isakov */ public abstract class Handler { diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/InvalidConstraintException.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/InvalidConstraintException.java index 42c54f36..cd5a78b4 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/InvalidConstraintException.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/InvalidConstraintException.java @@ -1,16 +1,31 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.program; -/*Generated by MPS */ public class InvalidConstraintException extends Exception { - public InvalidConstraintException(String message) { - super(message); - } + public InvalidConstraintException(String message) { + super(message); + } - public InvalidConstraintException(String message, Throwable ex) { - super(message, ex); - } + public InvalidConstraintException(String message, Throwable ex) { + super(message, ex); + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/InvalidRuleException.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/InvalidRuleException.java index 5679fd37..06eb9870 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/InvalidRuleException.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/InvalidRuleException.java @@ -1,16 +1,30 @@ -package jetbrains.mps.logic.reactor.program; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.program; public class InvalidRuleException extends Exception { - public InvalidRuleException(String message) { - super(message); - } + public InvalidRuleException(String message) { + super(message); + } - public InvalidRuleException(String message, Throwable throwable) { - super(message, throwable); - } + public InvalidRuleException(String message, Throwable throwable) { + super(message, throwable); + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/JavaPredicateSymbol.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/JavaPredicateSymbol.java index de880220..8fcb3e8d 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/JavaPredicateSymbol.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/JavaPredicateSymbol.java @@ -1,28 +1,47 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.program; -/*Generated by MPS */ - +/** + * A predicate symbol for an anonymous expression. + * + * @author Fedor Isakov + */ public class JavaPredicateSymbol extends PredicateSymbol { - public static final JavaPredicateSymbol EXPRESSION0 = new JavaPredicateSymbol(1); + public static final JavaPredicateSymbol EXPRESSION0 = new JavaPredicateSymbol(1); - public static final JavaPredicateSymbol EXPRESSION1 = new JavaPredicateSymbol(2); + public static final JavaPredicateSymbol EXPRESSION1 = new JavaPredicateSymbol(2); - public static final JavaPredicateSymbol EXPRESSION2 = new JavaPredicateSymbol(3); + public static final JavaPredicateSymbol EXPRESSION2 = new JavaPredicateSymbol(3); - public static final JavaPredicateSymbol EXPRESSION3 = new JavaPredicateSymbol(4); + public static final JavaPredicateSymbol EXPRESSION3 = new JavaPredicateSymbol(4); - private static final String EXPRESSION = "expression"; + private static final String EXPRESSION = "expression"; - private static JavaPredicateSymbol[] KNOWN_SYMBOLS = {EXPRESSION0, EXPRESSION1, EXPRESSION2, EXPRESSION3}; + private static JavaPredicateSymbol[] KNOWN_SYMBOLS = {EXPRESSION0, EXPRESSION1, EXPRESSION2, EXPRESSION3}; - public static JavaPredicateSymbol withArity(int arity) { - return KNOWN_SYMBOLS[arity]; - } + private JavaPredicateSymbol(int arity) { + super(EXPRESSION, arity); + } - private JavaPredicateSymbol(int arity) { - super(EXPRESSION, arity); - } + public static JavaPredicateSymbol withArity(int arity) { + return KNOWN_SYMBOLS[arity]; + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/Predicate.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/Predicate.java index 5835f656..0a665538 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/Predicate.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/Predicate.java @@ -1,17 +1,29 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.program; -/*Generated by MPS */ - -import java.util.Collection; -import java.util.List; - -import jetbrains.mps.logic.reactor.logical.LogicalContext; /** - * A predicate that is provided by a solver. Can be either told or asked. + * A predicate that is provided by a solver. Can be either told or asked. + * + * @author Fedor Isakov */ public interface Predicate extends AndItem { - PredicateSymbol symbol(); + PredicateSymbol symbol(); } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/PredicateSymbol.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/PredicateSymbol.java index 13d9c737..1bf26b9c 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/PredicateSymbol.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/PredicateSymbol.java @@ -1,17 +1,36 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.program; -/*Generated by MPS */ - +/** + * A predicate symbol. + * + * @author Fedor Isakov + */ public class PredicateSymbol extends Symbol { - public PredicateSymbol(String id, int arity) { - super(id, arity); - } + public PredicateSymbol(String id, int arity) { + super(id, arity); + } - @Override - public String toString() { - return id() + "()/" + arity(); - } + @Override + public String toString() { + return id() + "()/" + arity(); + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/Program.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/Program.java index 577d5c10..61c4dd88 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/Program.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/Program.java @@ -1,13 +1,30 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.program; -/*Generated by MPS */ import jetbrains.mps.logic.reactor.logical.LogicalContext; import java.util.List; /** - * A collection of handlers that constitute a constraint rules program. + * A collection of handlers that constitute a constraint rules program. + * + * @author Fedor Isakov */ public abstract class Program { diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/Rule.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/Rule.java index 713e4158..e00405ae 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/Rule.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/Rule.java @@ -1,34 +1,50 @@ -package jetbrains.mps.logic.reactor.program; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.program; /** * A constraint rule description. + * + * @author Fedor Isakov */ public abstract class Rule { - public abstract Rule.Kind kind(); + public abstract Rule.Kind kind(); - public abstract String tag(); + public abstract String tag(); - public abstract Iterable headKept(); + public abstract Iterable headKept(); - public abstract Iterable headReplaced(); + public abstract Iterable headReplaced(); - public abstract Iterable guard(); + public abstract Iterable guard(); - @Deprecated - public abstract Iterable body(); + @Deprecated + public abstract Iterable body(); - public abstract Iterable> bodyAlternation(); + public abstract Iterable> bodyAlternation(); - public abstract Iterable all(); + public abstract Iterable all(); - public enum Kind { - SIMPLIFICATION(), - PROPAGATION(), - SIMPAGATION() - } + public enum Kind { + SIMPLIFICATION(), + PROPAGATION(), + SIMPAGATION() + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/Symbol.java b/reactor/API/src/jetbrains/mps/logic/reactor/program/Symbol.java index dc13bf4d..ed9f1a24 100644 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/Symbol.java +++ b/reactor/API/src/jetbrains/mps/logic/reactor/program/Symbol.java @@ -1,54 +1,70 @@ -package jetbrains.mps.logic.reactor.program; +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -/*Generated by MPS */ +package jetbrains.mps.logic.reactor.program; /** * A symbol used by both constraints and predicates. Is uniquely identified by id and arity. + * + * @author Fedor Isakov */ public abstract class Symbol { - protected Symbol(String id, int arity) { - this.id = id; - this.arity = arity; - } + private String id; + private int arity; - public String id() { - return id; - } - - public int arity() { - return arity; - } - - @Override - public int hashCode() { - int result = 17; - result = 43 * result + ((id != null ? String.valueOf(id).hashCode() : 0)); - result = 31 * result + 37 * arity; - return result; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; + protected Symbol(String id, int arity) { + this.id = id; + this.arity = arity; } - Symbol that = (Symbol) o; - if ((id != null ? !(id.equals(that.id())) : that.id != null)) { - return false; - } - if (arity != that.arity) { - return false; + public String id() { + return id; } - return true; - } + public int arity() { + return arity; + } - private String id; - private int arity; + @Override + public int hashCode() { + int result = 17; + result = 43 * result + ((id != null ? String.valueOf(id).hashCode() : 0)); + result = 31 * result + 37 * arity; + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || this.getClass() != o.getClass()) { + return false; + } + + Symbol that = (Symbol) o; + if ((id != null ? !(id.equals(that.id())) : that.id != null)) { + return false; + } + if (arity != that.arity) { + return false; + } + + return true; + } } diff --git a/reactor/API/src/jetbrains/mps/logic/reactor/program/trace.info b/reactor/API/src/jetbrains/mps/logic/reactor/program/trace.info deleted file mode 100644 index a8cac5f8..00000000 --- a/reactor/API/src/jetbrains/mps/logic/reactor/program/trace.info +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/reactor/Core/Core.iml b/reactor/Core/Core.iml index 7e43c823..ca3a5ad3 100644 --- a/reactor/Core/Core.iml +++ b/reactor/Core/Core.iml @@ -9,41 +9,20 @@ - - - + + + + + + diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Controller.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Controller.kt index fe78da5a..aa30744a 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Controller.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Controller.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.evaluation.* diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/EvaluationSessionImpl.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/EvaluationSessionImpl.kt index 65a12a14..098e1c0c 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/EvaluationSessionImpl.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/EvaluationSessionImpl.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.evaluation.* diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Frame.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Frame.kt index 29f9000a..28d71442 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Frame.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Frame.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import com.github.andrewoma.dexx.collection.ConsList diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Invocation.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Invocation.kt index 8c73c479..ca11984a 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Invocation.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Invocation.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.evaluation.PredicateInvocation diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Logical.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Logical.kt index 2faac1d7..f8180ca0 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Logical.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Logical.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package jetbrains.mps.logic.reactor.core diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/MatchTrie.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/MatchTrie.kt index 6d8caf4d..bfea0876 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/MatchTrie.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/MatchTrie.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.evaluation.ConstraintOccurrence diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Matcher.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Matcher.kt index 09a79c94..fb98745e 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Matcher.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Matcher.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.evaluation.ConstraintOccurrence diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Occurrence.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Occurrence.kt index 864ef60e..f3029d23 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Occurrence.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Occurrence.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.evaluation.ConstraintOccurrence diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/PartialMatch.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/PartialMatch.kt index f9035347..e420b8da 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/PartialMatch.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/PartialMatch.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.evaluation.ConstraintOccurrence diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/PropagationHistory.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/PropagationHistory.kt index 03c33bd5..2eb0dac9 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/PropagationHistory.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/PropagationHistory.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import com.github.andrewoma.dexx.collection.ConsList diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/RuleIndex.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/RuleIndex.kt index ca5d1dbb..a3b5edf9 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/RuleIndex.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/RuleIndex.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.evaluation.ConstraintOccurrence diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Store.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Store.kt index bd242a96..e2ce6636 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/Store.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/Store.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import com.github.andrewoma.dexx.collection.DerivedKeyHashMap diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/TermImpl.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/TermImpl.kt index 55bb4ef7..dc7be155 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/TermImpl.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/TermImpl.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import jetbrains.mps.logic.reactor.logical.Logical diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/core/TermTrie.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/core/TermTrie.kt index 63d3b4f4..c6d6bdab 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/core/TermTrie.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/core/TermTrie.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.core import com.github.andrewoma.dexx.collection.ConsList diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/util/DexxCollections.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/util/DexxCollections.kt index 80043487..0671c89f 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/util/DexxCollections.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/util/DexxCollections.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.util import com.github.andrewoma.dexx.collection.ConsList diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/util/IdHashSet.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/util/IdHashSet.kt index 3e49c407..aa972176 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/util/IdHashSet.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/util/IdHashSet.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.util import com.github.andrewoma.dexx.collection.DerivedKeyHashMap diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/util/IdWrapper.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/util/IdWrapper.kt index 0f6b8095..d4fe3c19 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/util/IdWrapper.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/util/IdWrapper.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.util class IdWrapper(val wrapped: T) { diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/util/Iterables.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/util/Iterables.kt index 2715fa62..081c8fef 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/util/Iterables.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/util/Iterables.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.util import java.util.* diff --git a/reactor/Core/src/jetbrains/mps/logic/reactor/util/Profiler.kt b/reactor/Core/src/jetbrains/mps/logic/reactor/util/Profiler.kt index 3785281c..0aadd932 100644 --- a/reactor/Core/src/jetbrains/mps/logic/reactor/util/Profiler.kt +++ b/reactor/Core/src/jetbrains/mps/logic/reactor/util/Profiler.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.logic.reactor.util import java.util.* diff --git a/reactor/Core/src/jetbrains/mps/unification/Substitution.java b/reactor/Core/src/jetbrains/mps/unification/Substitution.java index bb695158..b45b282d 100644 --- a/reactor/Core/src/jetbrains/mps/unification/Substitution.java +++ b/reactor/Core/src/jetbrains/mps/unification/Substitution.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 JetBrains s.r.o. + * Copyright 2014-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/reactor/Core/src/jetbrains/mps/unification/Term.java b/reactor/Core/src/jetbrains/mps/unification/Term.java index 6352dd72..931a299e 100644 --- a/reactor/Core/src/jetbrains/mps/unification/Term.java +++ b/reactor/Core/src/jetbrains/mps/unification/Term.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 JetBrains s.r.o. + * Copyright 2014-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/reactor/Core/src/jetbrains/mps/unification/TermWrapper.java b/reactor/Core/src/jetbrains/mps/unification/TermWrapper.java index 63fc64f8..035795a5 100644 --- a/reactor/Core/src/jetbrains/mps/unification/TermWrapper.java +++ b/reactor/Core/src/jetbrains/mps/unification/TermWrapper.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package jetbrains.mps.unification; /** diff --git a/reactor/Core/src/jetbrains/mps/unification/Unification.java b/reactor/Core/src/jetbrains/mps/unification/Unification.java index 4e46a178..619b5ba6 100644 --- a/reactor/Core/src/jetbrains/mps/unification/Unification.java +++ b/reactor/Core/src/jetbrains/mps/unification/Unification.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 JetBrains s.r.o. + * Copyright 2014-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/reactor/Core/src/jetbrains/mps/unification/UnionFindTermGraphUnifier.java b/reactor/Core/src/jetbrains/mps/unification/UnionFindTermGraphUnifier.java index f2508d1d..269df7f6 100644 --- a/reactor/Core/src/jetbrains/mps/unification/UnionFindTermGraphUnifier.java +++ b/reactor/Core/src/jetbrains/mps/unification/UnionFindTermGraphUnifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 JetBrains s.r.o. + * Copyright 2014-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/reactor/Reactor.iml b/reactor/Reactor.iml index 74db282d..36a86c2b 100644 --- a/reactor/Reactor.iml +++ b/reactor/Reactor.iml @@ -2,41 +2,20 @@ - - - + + + + + + diff --git a/reactor/Test/Test.iml b/reactor/Test/Test.iml index d48b1bf1..a055416d 100644 --- a/reactor/Test/Test.iml +++ b/reactor/Test/Test.iml @@ -10,41 +10,20 @@ - - - + + + + + +