Skip to content
Snippets Groups Projects
Commit a913e351 authored by Jonas Blatt's avatar Jonas Blatt :ant:
Browse files

Merge branches 'patch-1' and 'patch-2' of...

Merge branches 'patch-1' and 'patch-2' of https://gitlab.uni-koblenz.de/fg-bks/br-verification-tool into develop
No related branches found
No related tags found
No related merge requests found
Showing
with 36 additions and 25 deletions
......@@ -23,7 +23,7 @@ public enum VerifierType {
true,
true,
false),
Equivalent("Checking for synonyms in columns.", EquivalentVerifier.class, true, false, false),
Equivalent("Checking for semantically equivalent rules.", EquivalentVerifier.class, true, false, false),
Overlap("Checking for overlapping rules.", OverlappingVerifier.class, true, true, false),
Missing("Checking for missing rules.", MissingVerifier.class, true, false, false),
PartialReduction(
......@@ -33,37 +33,37 @@ public enum VerifierType {
false,
false),
Interdeterminism(
"Identical, Overlapping or Subsumption with different conclusions.",
"Checking for rules that are activated together but have different conclusions.",
InterdeterminismVerifier.class,
false,
false,
false),
MultiTableIdentical(
"Checking for identical rules in multiple tables with identical outcome column.",
"Checking for identical rules in multiple tables (identical outcome column).",
MultiTableIdenticalVerifier.class,
true,
true,
true),
MultiTableOverlapping(
"Checking for overlapping rules in multiple tables with identical outcome column.",
"Checking for overlapping rules in multiple tables (identical outcome column).",
MultiTableOverlappingVerifier.class,
true,
true,
true),
MultiTableSubsumption(
"Checking for subsumptions in multiple tables with identical outcome column.",
"Checking for subsumptions in multiple tables (identical outcome column).",
MultiTableSubsumptionVerifier.class,
true,
true,
true),
MultiTableEquivalent(
"Checking for synonyms in columns in multiple tables with identical outcome column.",
"Checking for equivalent rules in multiple tables (identical outcome column).",
MultiTableEquivalentVerifier.class,
true,
false,
true),
MultiTablePartialReduction(
"Checking for partial reduction of rules (combination) in multiple tables with identical outcome column.",
"Checking for partial reduction of rules in multiple tables (identical outcome column).",
MultiTablePartialReductionVerifier.class,
true,
false,
......
......@@ -65,8 +65,8 @@ public class EquivalentVerifier extends AbstractVerifier {
protected String getMessageText(RuleIdentifier r1, RuleIdentifier r2, String v1, String v2) {
return String.format(
"In rule %d string \"%s\" and in rule %d string \"%s\": equal meaning? Are they synonyms?",
r1.getRowNumber(), v1, r2.getRowNumber(), v2);
"\"%s\" in rule %d and \"%s\" in rule %d are synonyms. Rules might be equivalent.",
v1, r1.getRowNumber(), v2, r2.getRowNumber());
}
@Override
......
......@@ -85,7 +85,7 @@ public class IdenticalVerifier extends AbstractVerifier {
sb.append(currentRuleIdentifiers.get(0).getTableName());
sb.append(" are identical.");
if (isDifferentConclusion) {
sb.append(" The output has different conclusions!");
sb.append(" The outputs have different conclusions!");
} else {
sb.append(" The output is the same.");
}
......
......@@ -29,7 +29,7 @@ public class MissingVerifier extends AbstractVerifier {
for (Value[] missingInt : missingRules) {
StringBuilder sb = new StringBuilder("In table ");
sb.append(d.getName()); // TODO: add real name
sb.append(" the following rule is not defined: (");
sb.append(", the following rule is not defined: (");
sb.append(
Arrays.stream(missingInt)
.map(Value::getOrgExpression)
......
......@@ -147,14 +147,14 @@ public class OverlappingVerifier extends AbstractVerifier {
StringBuilder sb = new StringBuilder();
sb.append("In table ");
sb.append(currentRuleIdentifiers.get(0).getTableName());
sb.append(" rules ");
sb.append(", rules ");
sb.append(
currentRuleIdentifiers.stream()
.map(c -> c.getRowNumber().toString())
.collect(Collectors.joining(", ")));
sb.append(" are overlapping.");
if (isDifferentConclusion) {
sb.append(" The output has different conclusions!");
sb.append(" The outputs have different conclusions!");
} else {
sb.append(" The output is the same.");
}
......
......@@ -172,7 +172,7 @@ public class SubsumptionVerifier extends AbstractVerifier {
StringBuilder sb = new StringBuilder();
sb.append("In table ");
sb.append(subsumptionRules.get(0).getRuleIdentifier().getTableName());
sb.append(" rule");
sb.append(", rule");
if (subsumptionRules.size() > 1) {
sb.append("s");
}
......@@ -182,9 +182,14 @@ public class SubsumptionVerifier extends AbstractVerifier {
.map(c -> c.getRuleIdentifier().getRowNumber().toString())
.sorted()
.collect(Collectors.joining(", ")));
sb.append(" subsumes rule");
if (subsumptionRules.size() > 1) {
sb.append("subsume"); //Plural
}else{
sb.append(" subsumes rule");
}
if (currentRuleIdentifiers.size() > 2) {
sb.append("s");
sb.append("s");
}
sb.append(" ");
sb.append(
......@@ -200,7 +205,7 @@ public class SubsumptionVerifier extends AbstractVerifier {
.collect(Collectors.joining(", ")));
sb.append(".");
if (isDifferentConclusion) {
sb.append(" The output has different conclusions!");
sb.append(" The outputs have different conclusions!");
} else {
sb.append(" The output is the same.");
}
......
......@@ -26,7 +26,7 @@ public class MultiTableEquivalentVerifier extends EquivalentVerifier {
@Override
protected String getMessageText(RuleIdentifier r1, RuleIdentifier r2, String v1, String v2) {
return String.format(
"In rule %d (%s) string \"%s\" and in rule %d (%s) string \"%s\": equal meaning? Are they synonyms?",
"In rule %d, (%s) string \"%s\" is a synonym to rule %d (%s) string \"%s\". Rules might be equivalent",
r1.getRowNumber(), r1.getTableName(), v1, r2.getRowNumber(), r2.getTableName(), v2);
}
}
......@@ -38,7 +38,7 @@ public class MultiTableIdenticalVerifier extends IdenticalVerifier {
.collect(Collectors.joining(", ")));
sb.append(" are identical.");
if (isDifferentConclusion) {
sb.append(" The output has different conclusions!");
sb.append(" The outputs have different conclusions!");
} else {
sb.append(" The output is the same.");
}
......
......@@ -39,7 +39,7 @@ public class MultiTableOverlappingVerifier extends OverlappingVerifier {
.collect(Collectors.joining(", ")));
sb.append(" are overlapping.");
if (isDifferentConclusion) {
sb.append(" The output has different conclusions!");
sb.append(" The outputs have different conclusions!");
} else {
sb.append(" The output is the same.");
}
......
......@@ -34,9 +34,8 @@ public class MultiTableSubsumptionVerifier extends SubsumptionVerifier {
List<Value> subsumptionRules,
boolean isDifferentConclusion) {
StringBuilder sb = new StringBuilder();
sb.append("In table ");
sb.append(subsumptionRules.get(0).getRuleIdentifier().getTableName());
sb.append(" rule");
sb.append("Rule");
if (subsumptionRules.size() > 1) {
sb.append("s");
}
......@@ -46,7 +45,14 @@ public class MultiTableSubsumptionVerifier extends SubsumptionVerifier {
.map(c -> c.getRuleIdentifier().getRowNumber().toString())
.sorted()
.collect(Collectors.joining(", ")));
sb.append(" subsumes rule");
sb.append("in table ");
sb.append(subsumptionRules.get(0).getRuleIdentifier().getTableName());
if (subsumptionRules.size() > 1) {
sb.append(" subsume rule");
}else{
sb.append(" subsumes rule");
}
if (currentRuleIdentifiers.size() > 2) {
sb.append("s");
}
......@@ -64,7 +70,7 @@ public class MultiTableSubsumptionVerifier extends SubsumptionVerifier {
.collect(Collectors.joining(", ")));
sb.append(".");
if (isDifferentConclusion) {
sb.append(" The output has different conclusions!");
sb.append(" The outputs have different conclusions!");
} else {
sb.append(" The output is the same.");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment