CLN Wiki · Reference for #spec
CLN Spec FORMAL
= formal specification @ v1.0
SUMMARY click to copy as CLN
=CLN Spec — formal rules for Cognitive Ladder Notation
.Defines syntax, semantics, and parsing
.01 · Syntax
→Line = Indent + Operator + Content
.02 · Semantics
→Indentation implies hierarchy
.03 · Parsing
.Linear scan, stack-based nesting
The rules of the ladder. Double-click any CLN line to anchor it. Right-click to tagmarry or record a decision.

01// Definition Term
// ##CS-DEF
=CLN Spec — the normative definition of the Cognitive Ladder Notation format
.Ensures interoperability between tools and human readers

02// Syntax Logic
// ##CS-SYN
→Line Structure
.Line ::= Indent Operator Content
.Indent ::= 0 or more groups of 4 spaces (or 1 tab)
.Operator ::= one of {= . → ~ ! ? * + -}
.Content ::= UTF-8 text (trimmed)
→Valid Operators (9 total)
-Semantic: = (Def), . (Prop), → (Impl)
-Context: ~ (Approx), ! (Alert), ? (Ques)
-List/Set: * (Ex), + (Plus), - (Minus)

03// Semantics Analysis
// ##CS-SEM
.Hierarchy (The Ladder)
→Indentation level N is a child of the nearest line at level N-1
.Level 0 lines are roots (independent statements)
.Operator Meaning
=Asserts identity (A is B)
.Asserts property (A has attribute B)
→Asserts causality/implication (A leads to B)
☐Level 0 (Root)
│└── Level 1 (Child)
▣ └── Level 2 (Grandchild)

04// Parsing Implication
// ##CS-PARSE
→Algorithm
.1. Read line
.2. Count leading spaces (divide by 4 for level)
.3. Extract first non-space char as Operator
.4. Remainder is Content
~Complexity
+O(N) linear scan (N = number of lines)
+Minimal state (only previous indentation stack needed)
◉ Anchor line
▤ #tagmarry
✎ Record decision