Updated the javadoc. Removed unused class.

This commit is contained in:
Fedor Isakov 2017-06-01 10:06:44 +02:00
parent c5c198cf8b
commit 89018e7fb6
22 changed files with 81 additions and 22 deletions

View File

@ -7,6 +7,9 @@ import jetbrains.mps.logic.reactor.program.Constraint;
import java.util.List;
/**
* Represents a run-time object corresponding to an actual constraint.
*/
public interface ConstraintOccurrence {
Constraint constraint();

View File

@ -3,6 +3,9 @@ package jetbrains.mps.logic.reactor.evaluation;
/*Generated by MPS */
/**
* Thrown in case evaluation fails.
*/
public class EvaluationFailureException extends RuntimeException {
public EvaluationFailureException(String message) {

View File

@ -7,6 +7,13 @@ import jetbrains.mps.logic.reactor.program.*;
import java.util.List;
/**
* 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.
*/
public abstract class EvaluationSession {
public static EvaluationSession current() {

View File

@ -3,6 +3,9 @@ package jetbrains.mps.logic.reactor.evaluation;
/*Generated by MPS */
/**
* An interface to be implemented by clients wishing to be notified of the events during evaluation.
*/
public interface EvaluationTrace {
void activate(ConstraintOccurrence occurrence);

View File

@ -2,6 +2,9 @@ package jetbrains.mps.logic.reactor.evaluation;
/*Generated by MPS */
/**
* Abstract interface to a predicate.
*/
public interface Instructible {
void tell(PredicateInvocation invocation);

View File

@ -4,6 +4,9 @@ package jetbrains.mps.logic.reactor.evaluation;
import jetbrains.mps.logic.reactor.program.Rule;
/**
* A binding of a rule and the constraints that matched its head.
*/
public interface MatchRule {
Rule rule();

View File

@ -7,6 +7,9 @@ import jetbrains.mps.logic.reactor.program.Predicate;
import java.util.List;
/**
* A run-time object representing invocation of a predicate.
*/
public interface PredicateInvocation {
Predicate predicate();

View File

@ -2,6 +2,9 @@ package jetbrains.mps.logic.reactor.evaluation;
/*Generated by MPS */
/**
* Abstract interface to a predicate.
*/
public interface Queryable extends Instructible {
boolean ask(PredicateInvocation invocation);

View File

@ -3,7 +3,7 @@ package jetbrains.mps.logic.reactor.evaluation;
import jetbrains.mps.logic.reactor.program.ConstraintSymbol;
/**
* @author Fedor Isakov
* A read-only view on the constraints store.
*/
public interface StoreView {

View File

@ -3,6 +3,11 @@ package jetbrains.mps.logic.reactor.logical;
/*Generated by MPS */
/**
* A run-time representation of a logical variable.
*
* @param <T> the value type
*/
public interface Logical<T> {
String name();

View File

@ -3,6 +3,9 @@ package jetbrains.mps.logic.reactor.logical;
/*Generated by MPS */
/**
* An abstract wrapper for a {@link Logical}.
*/
public interface LogicalOwner {
Logical<?> logical();

View File

@ -4,6 +4,10 @@ package jetbrains.mps.logic.reactor.logical;
import jetbrains.mps.unification.Term;
/**
* Not used in the API.
* @deprecated
*/
public interface LogicalUnification {
<TERM extends Term> TERM asRoot(TERM term);

View File

@ -3,16 +3,20 @@ package jetbrains.mps.logic.reactor.logical;
/*Generated by MPS */
public class MetaLogical<V> {
/**
* A declaration of a logical variable.
* @param <T> the value type
*/
public class MetaLogical<T> {
private static final String WILDCARD = "_";
public MetaLogical(String name, Class<V> type) {
public MetaLogical(String name, Class<T> type) {
this.name = name;
this.type = type;
}
public MetaLogical(Class<V> type) {
public MetaLogical(Class<T> type) {
this.name = MetaLogical.WILDCARD + System.identityHashCode(this);
this.type = type;
this.wildcard = true;
@ -26,7 +30,7 @@ public class MetaLogical<V> {
return wildcard;
}
public Class<V> type() {
public Class<T> type() {
return type;
}
@ -36,7 +40,7 @@ public class MetaLogical<V> {
}
private String name;
private Class<V> type;
private Class<T> type;
private boolean wildcard = false;
}

View File

@ -5,9 +5,13 @@ package jetbrains.mps.logic.reactor.logical;
import java.util.List;
import java.util.ArrayList;
public class MultiMetaLogical<V> extends MetaLogical<V> {
/**
* A declaration of a logical variable with index.
* @param <T>
*/
public class MultiMetaLogical<T> extends MetaLogical<T> {
public MultiMetaLogical(String name, Class<V> type, int cardinality) {
public MultiMetaLogical(String name, Class<T> type, int cardinality) {
super(name, type);
this.cardinality = cardinality;
init();
@ -17,7 +21,7 @@ public class MultiMetaLogical<V> extends MetaLogical<V> {
return cardinality;
}
public MetaLogical<V> logicalAt(int idx) {
public MetaLogical<T> logicalAt(int idx) {
return metaLogicals.get(idx);
}
@ -28,10 +32,10 @@ public class MultiMetaLogical<V> extends MetaLogical<V> {
private void init() {
for (int i = 0; i < cardinality; i++) {
metaLogicals.add(new MetaLogical<V>(name() + "_" + (i + 1), type()));
metaLogicals.add(new MetaLogical<T>(name() + "_" + (i + 1), type()));
}
}
private int cardinality;
private List<MetaLogical<V>> metaLogicals = new ArrayList<MetaLogical<V>>();
private List<MetaLogical<T>> metaLogicals = new ArrayList<MetaLogical<T>>();
}

View File

@ -3,6 +3,11 @@ package jetbrains.mps.logic.reactor.logical;
/*Generated by MPS */
/**
* A logical variable that can be joined with another variable to produce a union.
*
* @param <T> the value type
*/
public interface SolverLogical<T> extends Logical<T> {
/**

View File

@ -4,6 +4,9 @@ package jetbrains.mps.logic.reactor.program;
import java.util.List;
/**
* An abstract conjunct.
*/
public interface AndItem {
Symbol symbol();

View File

@ -7,7 +7,7 @@ import java.util.Collection;
import jetbrains.mps.logic.reactor.logical.LogicalContext;
/**
* A constraint provided by a handler. Can only be told.
* A constraint provided by a handler.
*/
public interface Constraint extends AndItem {

View File

@ -1,7 +1,10 @@
package jetbrains.mps.logic.reactor.program;
/**
* @author Fedor Isakov
* 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.
*/
public abstract class Handler {

View File

@ -6,6 +6,9 @@ import jetbrains.mps.logic.reactor.logical.LogicalContext;
import java.util.List;
/**
* A collection of handlers that constitute a constraint rules program.
*/
public abstract class Program {
public abstract String name();

View File

@ -3,6 +3,9 @@ package jetbrains.mps.logic.reactor.program;
/*Generated by MPS */
/**
* A constraint rule description.
*/
public abstract class Rule {
public abstract Rule.Kind kind();

View File

@ -1,9 +0,0 @@
package jetbrains.mps.logic.reactor.program;
/*Generated by MPS */
public interface Solver {
}

View File

@ -3,6 +3,9 @@ package jetbrains.mps.logic.reactor.program;
/*Generated by MPS */
/**
* A symbol used by both constraints and predicates. Is uniquely identified by id and arity.
*/
public abstract class Symbol {
protected Symbol(String id, int arity) {