edu.cs.ai.kreator.logic.metaconstraints
Interface MetaConstraint

All Superinterfaces:
Latexable
All Known Implementing Classes:
ExclusionConstraint, NotEqualConstraint

public interface MetaConstraint
extends Latexable

This interface decibes a Meta-Constraint that can be added to a RmeConditional. There are two type of Meta-Contraints: ExclusionConstraint e.g. X != (var1, var2, ..., varN) and NotEqualConstraint e.g. X != Y .

Author:
Sebastian Loh
See Also:
RmeConditional#addMetaConstraint(MetaConstraint), RmeConditional#addMetaConstraints(java.util.Collection)

Method Summary
 boolean equals(java.lang.Object other)
          Return true if other is a MetaConstraint and both have equal attributes.
 java.util.Set<Variable> getVariables()
          Returns all variables appearing in this constraint.
 boolean isValidSubstitution(java.util.Map<Variable,Constant> substitution)
          Checks if a given substitution violates this MetaConstraint.
 java.lang.String toLatex()
          Returns a Latex grammar conform string to generate variables, rules (conditionals) etc.
 java.lang.String toString()
           
 

Method Detail

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a String representation of this MetaConstraint.

equals

boolean equals(java.lang.Object other)
Return true if other is a MetaConstraint and both have equal attributes.

Overrides:
equals in class java.lang.Object
Parameters:
other - a Object
Returns:
true if other is a MetaConstraint and both have equal attributes.

getVariables

java.util.Set<Variable> getVariables()
Returns all variables appearing in this constraint.

Returns:
all variables appearing in this constraint.

isValidSubstitution

boolean isValidSubstitution(java.util.Map<Variable,Constant> substitution)
Checks if a given substitution violates this MetaConstraint. E.g if this is a NotEqualConstraint like X!=Y, then substitution.get(X).equals(substitution.get(Y) == false will be returned. If this is an ExclusionConstraint X != (v_1, ... ,v_n) then substitution.get(X).equals(v_1) should hold for all 1<= i <= n.

Parameters:
substitution - the substitution to check.
Returns:
true if the no MetaConstraint is violated by the given susbtitution.

toLatex

java.lang.String toLatex()
Description copied from interface: Latexable
Returns a Latex grammar conform string to generate variables, rules (conditionals) etc.

Specified by:
toLatex in interface Latexable
Returns:
a Latex grammar conform string.