IMPLEMENTED / F1 + F2
Logic, windows and occurrences
Implemented in 0.3.x: &, |, !, count comparisons, IN windows and kind[n] selectors, including errors.
Logical, not bitwise operators
P4:D(I<T&T)
P4:D(I<T|S<Z)
P4:D(!T)
P4:D(!(I<T))
P4:D((I<T|S<Z)&T)| Symbol | Meaning |
|---|---|
| & | Logical AND; semantics of C && |
| | | Logical OR; semantics of C || |
| ! | Logical NOT; !T requires T absent |
| () | Boolean grouping |
Precedence is grouped/atomic conditions, NOT, AND, OR. Validate the entire syntax, features and windows first; then short-circuit valid conditions left to right. T|IN(1,5,I) is a window error on P4 even when T is present.
Commas, grouping and chains
| Input | Equivalent |
|---|---|
| D(I|T&S) | D(I|(T&S)) |
| D(I|T,S) | D((I|T)&S) |
| D(I<T<S) | D(I<T&T<S) |
| D(I<T>S) | D(T>IS) |
P4:D(I|T&S)
P4:D(I|T,S)
P4:D((I|T)&S)A comma separates outer condition-list items. Use & and | inside a Boolean grouping. Commas in IN and advanced calls delimit their arguments. Do not conflate these contexts by textual replacement.
Per-kind counts and bare presence
P4:D(T=1&S=0)
P4:D(T!=0)
P4:D(T<=0)
P4:D(T>=1)| Form | Meaning |
|---|---|
| T | At least one T |
| T=1 | Exactly one T |
| T=0 / !T | No T |
| T!=1 | Not exactly one T |
| T<2 / T<=2 / T>2 / T>=2 | Comparison of the number of T occurrences |
= tests equality, never assignment. Counts are integers from 0 to 256 for one kind. TS=1 is not a group total and is rejected; T[2]=1 is also rejected because an occurrence is not a kind count. One standard 7-bag has no repeated kind; counts are also useful across bags and in custom multisets.
IN: inspect positions without resampling
P7:D(IN(1,3,T))
P7:D(IN(2,5,I<T&T))
P7:D(IN(1,3,T)&IN(4,7,I))IN(start,end,condition) uses inclusive one-based bounds. IN(2,2,T) tests position two. It does not change supply length, bags or correlations. Resampling P7:D(IN(1,3,T)) as P3:D(T)P4 produces a different set.
Bounds must fit the current scope. Zero, reversed bounds or positions beyond a known length produce INVALID_FILTER_WINDOW; no silent clipping. Nested IN bounds are relative to their immediate window, and absence is local to that window.
kind[n]: occurrence, not token identity
{P7P7}:D(I[2]<T[2])
{P7P7}:D(I[2]<T[2],T[2])
{P7P7}:D(IN(5,12,T[2]<I))kind[n] selects the nth occurrence inside the current inspection scope (n=1..256). I equals I[1]; repeated II remains a kind group, not I[2]. Inside IN, count again from that window.
| Condition | State | Result |
|---|---|---|
| I[2]<T[2] | Only second I exists | true |
| I[2]<T[2] | No second I | false |
| I[2]<T[2],T[2] | No second T | false |
The ordinal is not a global token-origin or hold ID. U rejects n>1 selectors; n=1 remains ordinary first-occurrence semantics.
Unsupported spellings and outcomes
| Rejected spelling | Use instead |
|---|---|
| T&&I / T||I | T&I / T|I |
| T==1 | T=1 |
| !I<T | !(I<T) |
| HAS(T) / D?(I<T) | T / D(I<T) |
| P4::D(T) / [=P4]:D(T) | P4:D(T) / {P4}:D(T) |
| TS=1 | Write per-kind counts explicitly |
Distinguish invalid syntax, unsupported features, proven UNSAT, NOT_CHECKED and budget-limited INCOMPLETE. One impossible OR branch must not delete surviving branches; NOT and different windows must not leak into one positive cycle graph.