← Back to 20260317 archive

Worked Example: Boolean OR to SN

This is the first end-to-end P-programming example in the new namespace. It starts from a straight-line C assignment, translates the variables into event spaces, translates the assignment semantics into conjunction patterns, and produces a concrete SN artifact that the UMR parser can load.

C Source

unsigned char a;
unsigned char b;
unsigned char c;

a = b | c;

Boolean Restriction

To keep the first example fully explicit, we restrict to the boolean case {0,1}. That yields three event spaces:

Operational Semantics as Patterns

InputsOutput
(b=0, c=0)a=0
(b=0, c=1)a=1
(b=1, c=0)a=1
(b=1, c=1)a=1

Ordered as ES_b, ES_c, ES_a, the global event indices are 0,1,2,3,4,5. The assignment becomes four conjunction entries in one LPP:

0 2 4 255.
0 3 5 255.
1 2 5 255.
1 3 5 255.

Artifacts

Verification Path

The concrete parser check is: ./umr info docs/archive/20260317/boolean-or-example.sn