Package mepk.kernel
Class Statement
java.lang.Object
mepk.kernel.Statement
This class represents an statement. Statements are values: they cannot be
modified after they have been created. They are
equal
if (and only if) they have the same structure. It is only possible to create
an instance using the static methods in this class.-
Method Summary
Modifier and TypeMethodDescriptionbooleanexpand(Abbreviation abbreviation) Expand this statement by applying the given abbreviation.Returns the conclusion of this statement.getDVRs()Returns the distinct-variable restrictions (DVRs) of this statement.Collection<? extends Expression>Returns the hypotheses of this statement.inthashCode()static StatementStat(List<Expression> hypotheses, Expression conclusion) Create a new instance with an empty set of DVRs.static StatementStat(DVRSet dvrs, List<Expression> hypotheses, Expression conclusion) Create a new instance.substitute(String varName, Expression replacement, Map<String, String> typesOfNewVars) Create a new statement, by replacing one variable in this statement by an expression, and optionally adding type expressions (to make resulting statement type-correct).toString()weaken(DVRSet addedDVRs, Expression... addedHypotheses) Create a new statement, by adding hypotheses and DVRs to this statement.
-
Method Details
-
Stat
Create a new instance with an empty set of DVRs.- Parameters:
hypotheses- the hypothesesconclusion- the conclusion- Returns:
- the created statement
-
Stat
Create a new instance.- Parameters:
dvrs- the DVRshypotheses- the hypothesesconclusion- the conclusion- Returns:
- the created statement
-
getDVRs
Returns the distinct-variable restrictions (DVRs) of this statement.- Returns:
- the DVRs
-
getHypotheses
Returns the hypotheses of this statement.- Returns:
- the hypotheses
-
getConclusion
Returns the conclusion of this statement.- Returns:
- the conclusion
-
hashCode
public int hashCode() -
equals
-
toString
-
substitute
public Statement substitute(String varName, Expression replacement, Map<String, String> typesOfNewVars) Create a new statement, by replacing one variable in this statement by an expression, and optionally adding type expressions (to make resulting statement type-correct).- Parameters:
varName- the variable namereplacement- the replacement expressiontypesOfNewVars- the additional type expressions- Returns:
- the new statement
-
weaken
Create a new statement, by adding hypotheses and DVRs to this statement.- Parameters:
addedDVRs- the added DVRsaddedHypotheses- the added hypotheses- Returns:
- the new statement
-
expand
Expand this statement by applying the given abbreviation. Note that if conditions are used, then this will usually result in multiple statements, e.g., abbreviation "(group-elem x)abbreviates(Real x)for which(> x (0))" would expand(group-elem x) AND (group-elem y) ==> (group-elem (op x y))to-
(Real x) AND (> x (0)) AND (Real y) AND (> y (0)) ==> (Real (op x y)) -
(Real x) AND (> x (0)) AND (Real y) AND (> y (0)) ==> (> (op x y) (0))
- Parameters:
abbreviation- the abbreviation to expand- Returns:
- the set of statements resulting from the expansion
-
-