Class Neo4jConditionEvaluator
java.lang.Object
org.evomaster.client.java.controller.neo4j.heuristics.Neo4jConditionEvaluator
Evaluates the truthness
ρ(condition, m) of a single CypherCondition under a
structural mapping m, recursively over the typed boolean tree the parser produces
(And/Or/Xor/Not, comparisons, label/type/property leaves).
A condition that cannot be valuated under the mapping (an absent property, an unbound variable, an
opaque/raw operand) scores UNVALUATABLE rather than null: a low but non-zero
ofTrue that still takes part in the aggregation. Never returns null.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classComputesρfor one condition under a fixed mapping. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.evomaster.client.java.distance.heuristics.TruthnessScore of a condition that cannot be valuated under the mapping. -
Constructor Summary
ConstructorsConstructorDescriptionNeo4jConditionEvaluator(org.evomaster.client.java.sql.internal.TaintHandler taintHandler) -
Method Summary
Modifier and TypeMethodDescriptionorg.evomaster.client.java.distance.heuristics.TruthnessevaluateCondition(CypherCondition condition, Neo4jMapping mapping) Returnsρ(condition, mapping), nevernull: a condition that cannot be valuated (an absent property, an unbound variable, an opaqueRawCondition) scoresUNVALUATABLE.static org.evomaster.client.java.distance.heuristics.TruthnessgetContains(String str, String substring) static org.evomaster.client.java.distance.heuristics.TruthnessgetEndsWith(String str, String suffix) static org.evomaster.client.java.distance.heuristics.TruthnessgetStartsWith(String str, String prefix) static org.evomaster.client.java.distance.heuristics.TruthnesslabelInSet(String label, Set<String> labels) label_in_set(L, labels): TRUE if the exact label is present; FALSE if the element has no labels; otherwise the best per-label string similarity scaled from baseC.static org.evomaster.client.java.distance.heuristics.TruthnessDirect string equality truthness:TRUEwhen the strings are equal, otherwiseofTrueis the left-alignment edit distance scaled from baseC(so it never drops belowC) andofFalse = 1.static org.evomaster.client.java.distance.heuristics.TruthnessUn-based string similarity (ofTrue = 1 - normalize(distance)), used only as the per-label score insidelabelInSet(java.lang.String, java.util.Set<java.lang.String>), which then re-bases the best of them withscaleTrue(C, ...).
-
Field Details
-
UNVALUATABLE
public static final org.evomaster.client.java.distance.heuristics.Truthness UNVALUATABLEScore of a condition that cannot be valuated under the mapping. It is aggregated like any other score, so such a condition lowers the result without hiding the gradient of its siblings.Compared by identity, so that NOT can propagate it instead of inverting its low
ofTrueinto a near-true score.
-
-
Constructor Details
-
Neo4jConditionEvaluator
public Neo4jConditionEvaluator() -
Neo4jConditionEvaluator
public Neo4jConditionEvaluator(org.evomaster.client.java.sql.internal.TaintHandler taintHandler)
-
-
Method Details
-
evaluateCondition
public org.evomaster.client.java.distance.heuristics.Truthness evaluateCondition(CypherCondition condition, Neo4jMapping mapping) Returnsρ(condition, mapping), nevernull: a condition that cannot be valuated (an absent property, an unbound variable, an opaqueRawCondition) scoresUNVALUATABLE. Dispatch is done with aCypherConditionVisitorso every condition type is handled explicitly: there is noinstanceofchain and no silent fall-through for an unhandled type. -
stringEqualityTruthness
public static org.evomaster.client.java.distance.heuristics.Truthness stringEqualityTruthness(String a, String b) Direct string equality truthness:TRUEwhen the strings are equal, otherwiseofTrueis the left-alignment edit distance scaled from baseC(so it never drops belowC) andofFalse = 1. Used where a string is compared for equality on its own: relationship types and string-valued property/WHERE equality.Both arguments must be non-null: this is only reached with two resolved strings (a relationship type, or two string values already confirmed present by
equalityTruthness(java.lang.Object, java.lang.Object)). A Cyphernullliteral never reaches here, since it is handled one level up byequalityTruthness(java.lang.Object, java.lang.Object). -
stringSimilarityTruthness
public static org.evomaster.client.java.distance.heuristics.Truthness stringSimilarityTruthness(String a, String b) Un-based string similarity (ofTrue = 1 - normalize(distance)), used only as the per-label score insidelabelInSet(java.lang.String, java.util.Set<java.lang.String>), which then re-bases the best of them withscaleTrue(C, ...). Kept separate fromstringEqualityTruthness(java.lang.String, java.lang.String)so the baseCis applied exactly once on the label path (applying it here as well would double-count it). -
labelInSet
public static org.evomaster.client.java.distance.heuristics.Truthness labelInSet(String label, Set<String> labels) label_in_set(L, labels): TRUE if the exact label is present; FALSE if the element has no labels; otherwise the best per-label string similarity scaled from baseC. -
getStartsWith
-
getEndsWith
-
getContains
-