| @@ -1202,6 +1202,55 @@ |
| 1202 | 1202 | - **Consequence:** every §10.3.4.6 range *and* comparison-test-value grammar form is now in — |
| 1203 | 1203 | the ADR-27 → ADR-32 range arc is closed. The remaining `in`-RHS deferral (`not(tests)` |
| 1204 | 1204 | negation) was itself resolved by ADR-30; nothing range-shaped remains open. |
| 1205 | +- **Correction (ADR-33):** the consequence list above understated the value. ADR-32 said the |
| 1206 | + comparison-test value has "no host type, conforms to nothing but `Any`" and left its |
| 1207 | + `member_access` returning error-null. §10.3.2.7 contradicts that — it is *"a typed instance |
| 1208 | + of the range type"* with range properties. ADR-33 supplies them without disturbing the |
| 1209 | + opaque equality this ADR fixed. |
| 1210 | + |
| 1211 | +## ADR-33: range properties + `instance of range<T>` for the comparison-test value (DMN §10.3.2.7) |
| 1212 | + |
| 1213 | +- **Context:** ADR-32 modelled `(< 10)` / `(= 10)` / … as the opaque `Value::UnaryTestVal`, |
| 1214 | + correctly making its *equality* reflexive-only (`(=10) = [10..10]` is **false**, off 0068). |
| 1215 | + But it also declared the value typeless ("conforms to nothing but `Any`") and gave it no |
| 1216 | + member access — `member_access` fell through to `Value::Error` → null. **§10.3.2.7 |
| 1217 | + ("Ranges", Table 42) says otherwise:** the single-endpoint-with-operator form (grammar rule |
| 1218 | + 7.a) is *"a typed instance of the range type"*. It **has** the four range properties — the |
| 1219 | + *other* endpoint is **undefined** (property `null`, inclusivity flag `false`) and the present |
| 1220 | + endpoint's inclusivity follows the operator — and it **is** a `range<T>`. TCK |
| 1221 | + `0074-feel-properties` `range_006`–`011` pin those property values exactly. So two TCK suites |
| 1222 | + fix two *independent facets* of the same value: 0068 fixes **equality** (opaque — identical |
| 1223 | + properties to `[10..10]` yet *not equal* to it), 0074 fixes **properties** (range-shaped). |
| 1224 | +- **Decision:** keep ADR-32's opaque equality untouched and add the two range-typed |
| 1225 | + *projections*, both derived from the boxed `{ op, endpoint }`: |
| 1226 | + - **`member_access` — a `Value::UnaryTestVal` arm** (`eval.rs`), mirroring the `Value::Range` |
| 1227 | + arm. Per Table 42, by operator `(start, start incl, end, end incl)` is: `<` → |
| 1228 | + `(null, false, e, false)`; `<=` → `(null, false, e, true)`; `>` → `(e, false, null, false)`; |
| 1229 | + `>=` → `(e, true, null, false)`; `=` → `(e, true, e, true)`; `!=` → `(e, false, e, false)`. |
| 1230 | + An undefined endpoint's property is `null` (matching the unbounded-`Range` `None` rule, |
| 1231 | + ADR-31); an unknown property is value-null (it *has* properties). The crux: `(=10).start` |
| 1232 | + and `(=10).end` are `10`/`10` even though `(=10) ≠ [10..10]` — properties and equality are |
| 1233 | + decoupled. |
| 1234 | + - **`instance of range<T>` — a `Value::UnaryTestVal` arm in `value_conforms_to`** (`types.rs`). |
| 1235 | + The single present endpoint must conform to `T`; the undefined side conforms vacuously, |
| 1236 | + exactly like an unbounded `Range` endpoint. So `(<10) instance of range<number>` is **true** |
| 1237 | + while `(<10) = (..10)` stays **false** (ADR-32) — conformance and equality are likewise |
| 1238 | + independent. This *corrects* ADR-32's "conforms to nothing but `Any`", which was a §10.3.2.7 |
| 1239 | + deviation. |
| 1240 | +- **Why no equality change:** a value with start/end/inclusivity identical to `[10..10]` that is |
| 1241 | + nonetheless `≠ [10..10]` is exactly what 0068 + 0074 jointly demand; `member_access` is a |
| 1242 | + *read*, not a promotion. `feel_equal_depth`'s `UnaryTestVal` arms (ADR-32) are unchanged, as is |
| 1243 | + the 40-byte `Value` size. |
| 1244 | +- **Tests:** `range_properties` extended with the six-operator property table, the |
| 1245 | + unknown-property null, and the `instance of range<T>` conformance (incl. a wrong-endpoint-type |
| 1246 | + `false`). Re-ingested **only** `0074-feel-properties` (the five `range_006`/`007`/`009`/`010`/`011` |
| 1247 | + boxed-context decisions left in `OUT_OF_SCOPE_EXPR_SKIPS` by ADR-29's proviso, now removed). |
| 1248 | + `0074` **48 → 53**; suite **2872 → 2877**; closed loop (`fixtures_test`) green. |
| 1249 | +- **Consequence:** §10.3.2.7's *"typed instance of the range type"* is now honoured in full for |
| 1250 | + the comparison-test value — both its range properties (0074) and its `instance of range<T>` |
| 1251 | + conformance — while its equality stays opaque per 0068. `range_008`/`range_012` (`!=` cases) |
| 1252 | + remain commented out upstream (dmn-tck PR #671); the `member_access`/conformance arms already |
| 1253 | + cover `!=` for when they return. |
| 1205 | 1254 | |
| 1206 | 1255 | ## Adding a wrapper — the host-binding contract |
| 1207 | 1256 | |
| @@ -1620,8 +1669,10 @@ |
| 1620 | 1669 | structural equality. **Unlocked:** `0074-feel-properties` range_001–005 (+5 fixture |
| 1621 | 1670 | cases, 20 range-property assertions); `1130-feel-interval` all 14 Allen-relation |
| 1622 | 1671 | decisions (+14 fixture cases, 132 boolean assertions). Suite 2853 → 2872. |
| 1623 | | - **Caveats (ADR-29 proviso):** `0074` range_006–011 (opaque comparison-test values |
| 1624 | | - `(<10)` / `(>=10)` etc., ADR-32) are excluded — `member_access` for |
| 1625 | | - `Value::UnaryTestVal` is not yet implemented; they are in `OUT_OF_SCOPE_EXPR_SKIPS`. |
| 1672 | + **Former caveat now closed (ADR-33):** `0074` range_006–011 (the comparison-test |
| 1673 | + values `(<10)` / `(>=10)` etc.) were excluded under the ADR-29 proviso because |
| 1674 | + `member_access` for `Value::UnaryTestVal` was unimplemented; ADR-33 added the |
| 1675 | + range-property and `instance of range<T>` arms and re-ingested them (+5, suite |
| 1676 | + 2872 → 2877), so they are no longer in `OUT_OF_SCOPE_EXPR_SKIPS`. |
| 1626 | 1677 | 0030/0031 (boxed context + user-defined functions) remain outside the slice via the |
| 1627 | 1678 | free-name scan (ADR-23) and need no separate exclusion. |