TessemblyDocs
0.3.x · RFC3 GitHub

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

tessembly
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)
SymbolMeaning
&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

InputEquivalent
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)
tessembly
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

tessembly
P4:D(T=1&S=0)
P4:D(T!=0)
P4:D(T<=0)
P4:D(T>=1)
FormMeaning
TAt least one T
T=1Exactly one T
T=0 / !TNo T
T!=1Not exactly one T
T<2 / T<=2 / T>2 / T>=2Comparison 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

tessembly
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

tessembly
{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.

ConditionStateResult
I[2]<T[2]Only second I existstrue
I[2]<T[2]No second Ifalse
I[2]<T[2],T[2]No second Tfalse

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 spellingUse instead
T&&I / T||IT&I / T|I
T==1T=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=1Write 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.