shpoont opened a new issue, #7238:
URL: https://github.com/apache/incubator-kie/issues/7238

   ### Describe the bug
   
   Drools DMN 10.2.0 reports a decision-table gap for a finite numeric input 
domain even though every allowed value matches a rule.
   
   The reduced example has one input, `score`, with allowed values `0, 2, 4`. 
The two UNIQUE rules are `<= 0` and `>= 2`. All three allowed values return the 
expected decisions, but table analysis reports `DECISION_TABLE_GAP` with one 
gap.
   
   ### Expected behavior
   
   No gap for the domain `0, 2, 4`: there is no allowed input between 0 and 2.
   
   If the domain is changed to `0, 1, 2, 3, 4`, the same rules should report a 
real gap because the now-allowed value `1` matches neither rule.
   
   ### Actual behavior
   
   Schema/model/compilation validation completes without ERROR diagnostics. The 
analyzer retains a discrete domain containing exactly the declared values, with 
`error=false`.
   
   | Domain and rules | Native decision results | Analyzer result |
   | --- | --- | --- |
   | `0, 2, 4`; `<= 0` / `>= 2` | `0 -> none`, `2 -> full`, `4 -> full` | One 
gap, no overlaps |
   | `0, 2, 4`; equivalent literal cells `0` / `2, 4` | Same three decisions | 
No gaps or overlaps |
   | `0, 1, 2, 3, 4`; original comparison cells | `0 -> none`, `1 -> null` (no 
match), `2/3/4 -> full` | One gap, no overlaps; expected for this control |
   
   The literal variant is a diagnostic control, not a proposed requirement to 
rewrite the original table.
   
   ### How to reproduce
   
   Component: Drools DMN, `kie-dmn-validation` 10.2.0. Save this invented 
example as `numeric-sparse-gap.dmn`:
   
   ```xml
   <?xml version="1.0" encoding="UTF-8"?>
   <definitions xmlns="https://www.omg.org/spec/DMN/20230324/MODEL/";
                id="model" name="Booking" namespace="urn:sme:dmn:fixture">
     <inputData id="input_score" name="score">
       <variable id="var_score" name="score" typeRef="number"/>
     </inputData>
     <decision id="decision" name="Refund">
       <variable id="var_refund" name="Refund" typeRef="string"/>
       <informationRequirement id="needs_score"><requiredInput 
href="#input_score"/></informationRequirement>
       <decisionTable id="table" hitPolicy="UNIQUE">
         <input id="column_score">
           <inputExpression id="expr_score" 
typeRef="number"><text>score</text></inputExpression>
           <inputValues id="domain_score"><text>0, 2, 4</text></inputValues>
         </input>
         <output id="column_refund">
           <outputValues id="domain_refund"><text>"full", 
"none"</text></outputValues>
         </output>
         <rule id="rule_low">
           <inputEntry id="low_test"><text>&lt;= 0</text></inputEntry>
           <outputEntry id="low_result"><text>"none"</text></outputEntry>
         </rule>
         <rule id="rule_high">
           <inputEntry id="high_test"><text>&gt;= 2</text></inputEntry>
           <outputEntry id="high_result"><text>"full"</text></outputEntry>
         </rule>
       </decisionTable>
     </decision>
   </definitions>
   ```
   
   The validator API invocation used for the observations is:
   
   ```java
   var validator = DMNValidatorFactory.newValidator(List.of());
   try {
       var messages = validator.validate(new StringReader(xml),
           DMNValidator.Validation.VALIDATE_SCHEMA,
           DMNValidator.Validation.VALIDATE_MODEL,
           DMNValidator.Validation.VALIDATE_COMPILATION,
           DMNValidator.Validation.ANALYZE_DECISION_TABLE);
       messages.forEach(System.out::println);
   } finally {
       validator.dispose();
   }
   ```
   
   The case observations were obtained separately with `kie-dmn-core` 10.2.0, 
`DMNRuntimeBuilder.usingStrict()`, explicit `RuntimeModeOption("strict")`, 
runtime type checking enabled, and `evaluateById(..., "decision")` using 
numeric inputs. All inputs were within each variant's declared domain.
   
   ### Environment
   
   - Drools / `kie-dmn-core` / `kie-dmn-validation`: 10.2.0.
   - Java: Amazon Corretto 25.0.3.
   - OS: macOS, arm64.
   - Execution: direct Java invocation with prepared 10.2.0 JARs; no Quarkus, 
Spring Boot, Kogito application or GraalVM.
   - The unreleased main branch has not been built or executed for this report.
   
   Is this a known limitation of gap analysis for discrete numeric domains, or 
should the comparison form produce the same coverage result as the equivalent 
literal form?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to