Public repository: timo / feel

Reader

An interpreter of FEEL, written in Rust, with integrations for PostgreSQL, WASM, Lua, and Python.

docs: ADR-33 + ROADMAP — range properties for the comparison-test value

public

docs: ADR-33 + ROADMAP — range properties for the comparison-test value

ADR-33 records the §10.3.2.7 reconciliation: the comparison-test value has
range properties and conforms to `range<T>` (0074) while its equality stays
opaque (0068), two independent facets. Correct ADR-32's "conforms to nothing
but Any" claim, close the ADR-29 ingester caveat, and bump the coverage figure
to 2877.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changeset6be256e6f4ba6e4a335d612ea4eb09dc91b8eb31
Author (claimed)Timo Stolz <timo.stolz@gmail.com>,
Parentsa419e4173931
Children
Pushlog
by timo via ssh

modified DECISIONS.md +54 −3

@@ -1202,6 +1202,55 @@
12021202
 - **Consequence:** every §10.3.4.6 range *and* comparison-test-value grammar form is now in —
12031203
   the ADR-27 → ADR-32 range arc is closed. The remaining `in`-RHS deferral (`not(tests)`
12041204
   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.
12051254
 
12061255
 ## Adding a wrapper — the host-binding contract
12071256
 
@@ -1620,8 +1669,10 @@
16201669
   structural equality. **Unlocked:** `0074-feel-properties` range_001–005 (+5 fixture
16211670
   cases, 20 range-property assertions); `1130-feel-interval` all 14 Allen-relation
16221671
   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`.
16261677
   0030/0031 (boxed context + user-defined functions) remain outside the slice via the
16271678
   free-name scan (ADR-23) and need no separate exclusion.

modified ROADMAP.md +22 −5

@@ -7,7 +7,7 @@
77
 without re-deriving the analysis.
88
 
99
 Coverage figures are case counts from `tools/ingest_tck.py` over the DMN-TCK
10
-compliance-level-3 suites. Today the fixture suite is **2872 cases / 87 files**
10
+compliance-level-3 suites. Today the fixture suite is **2877 cases / 87 files**
1111
 (`cargo test -p feel-core --test fixtures_test -- --nocapture`).
1212
 
1313
 ---
@@ -133,10 +133,11 @@
133133
 - **Range properties** `.start` / `.end` / `.start included` / `.end included` — a
134134
   `Value::Range` arm in `member_access`. `0074-feel-properties`'s `range_001`–`005`
135135
   decisions (interval-range properties) are now **ingested** as boxed-context fixture
136
-  cases (+5; `0074` suite 43 → 48). `range_006`–`011` (opaque comparison-test values
137
-  `(<10)` etc., ADR-32) are skipped — `member_access` for `UnaryTestVal` is not yet
138
-  implemented (`OUT_OF_SCOPE_EXPR_SKIPS`); the `range_properties` unit test covers all
139
-  bracket forms as a fast regression. `1130-feel-interval`'s 14 Allen-relation
136
+  cases (+5; `0074` suite 43 → 48). `range_006`–`011` (the comparison-test values
137
+  `(<10)` etc., ADR-32) followed in **ADR-33** — a `Value::UnaryTestVal` arm in both
138
+  `member_access` and `instance of range<T>` (+5; `0074` 48 → 53); the
139
+  `range_properties` unit test covers all bracket forms *and* the six operator forms
140
+  as a fast regression. `1130-feel-interval`'s 14 Allen-relation
140141
   context decisions are now also **ingested** (+14 fixture cases, 132 boolean
141142
   assertions covered). The ingester relaxation (reverse-bracket `..` scan +
142143
   multi-word `.member` blanking) did unlock **+8** related cases in
@@ -185,6 +186,22 @@
185186
 **101 → 109** (the eight `range_006`/`range_007…012` cases). Exercised by the
186187
 `value_position_comparison_test` unit test (incl. an `in`-position regression block).
187188
 
189
+### Shipped: range properties + `instance of` for the comparison-test value (ADR-33)
190
+
191
+The other half of §10.3.2.7 that ADR-32 left open. The spec calls `(< 10)` *"a typed
192
+instance of the range type"* (Table 42): it **has** range properties (the operator's
193
+missing endpoint is `null` + not included; the present endpoint's inclusivity follows
194
+the operator) and it **is** a `range<T>`. ADR-32 had declared it typeless and gave it no
195
+member access — a §10.3.2.7 deviation. ADR-33 adds a `Value::UnaryTestVal` arm to both
196
+`member_access` (`eval.rs`) and `value_conforms_to` (`types.rs`), derived from the boxed
197
+`{ op, endpoint }`, **without** touching its opaque equality: `(=10).start`/`.end` are
198
+`10`/`10` though `(=10) ≠ [10..10]`, and `(<10) instance of range<number>` is true though
199
+`(<10) = (..10)` is false — properties/conformance and equality are independent facets,
200
+exactly as 0068 + 0074 jointly demand. Re-ingested `0074-feel-properties` `range_006`/
201
+`007`/`009`/`010`/`011` (the five cases ADR-29's proviso had parked in
202
+`OUT_OF_SCOPE_EXPR_SKIPS`); `0074` **48 → 53**, suite **2872 → 2877**. Exercised by the
203
+extended `range_properties` unit test.
204
+
188205
 ---
189206
 
190207
 ## Smaller, independent deferrals