Recursive-Logic-Core/SLAP

Deterministic, zero-overhead context serialization & line-based tree-state protocol.

0

stars

4

commits

Python

primary language

Sep 11, 2026

updated

README

SLAP Banner

SLAP

Structural Line Algorithm Path

Deterministic, zero-overhead context serialization and tree-state protocol.

License: MIT Format: SLAP Architecture: Zero--Overhead


Abstract

Modern data serialization formats (JSON, YAML, XML) carry massive historical ballast: redundant quotation marks, nested closing brackets, fragile indentation rules, and zero native support for state inheritance.

SLAP (Structural Line Algorithm Path) is an ultra-minimalist, line-deterministic protocol designed for pure efficiency. It maps hierarchical tree topologies and cascading context inheritance using single-character prefix vectors. No brackets, no commas, no syntax noise.


Core Principles

  1. Zero Syntax Overhead: Only semantic data and explicit prefix markers exist. Whitespace within identifiers is strictly prohibited (use _).
  2. Deterministic Single-Pass Parsing (O(N)): Evaluated strictly line-by-line using a lightweight state machine. No lookaheads, no backtrack buffers, no bracket-balancing.
  3. Cascading State Inheritance: Attributes defined at a higher node automatically cascade down through all subsequent child nodes until the context is explicitly reset by a new root entity.
  4. Visual Depth Indexing: Structural hierarchy is declared at index 0 of each line.

Syntax Specification

1. Entities & Objects (-, --, ---)

  • - declares a root entity (resets previous context).
  • Each additional - increases the hierarchical depth level ($N+1$).

2. Attributes & States (., .., ...)

  • . declares a globally inherited attribute for the current root branch.
  • .. declares a localized attribute bound strictly to the preceding sub-node.
  • Key-value pairs are delimited by a single colon (:).

Protocol Comparison

SLAP Representation

-cluster_alpha
.zone:eu_central
.security:strict
--node_01
--node_02
..role:backup
-cluster_beta
.zone:us_east
--node_03

Legacy JSON Representation

{
  "cluster_alpha": {
    "zone": "eu_central",
    "security": "strict",
    "nodes": [
      { "id": "node_01", "zone": "eu_central", "security": "strict" },
      { "id": "node_02", "zone": "eu_central", "security": "strict", "role": "backup" }
    ]
  },
  "cluster_beta": {
    "zone": "us_east",
    "nodes": [
      { "id": "node_03", "zone": "us_east" }
    ]
  }
}

Result: SLAP reduces character payload by over 50% while completely removing bracket-closure failure vectors.


Reference Implementation

The reference parser is provided in SLAP.py as a standalone, zero-dependency engine:

from SLAP import parse_slap

raw_slap_data = """
-alpha
.status:active
--beta
--gamma
..role:worker
-delta
.status:idle
--epsilon
"""

nodes = parse_slap(raw_slap_data)
for node in nodes:
    print(f"Path: {node['path']} | Attributes: {node['attributes']}")

License

This project is licensed under the MIT License - see the LICENSE file for details.

Developed as part of the Recursive-Logic-Core architecture framework.

Contributors

Recursive-Logic-Core/SLAP

Deterministic, zero-overhead context serialization & line-based tree-state protocol.

0

stars

4

commits

Python

primary language

Sep 11, 2026

updated

README

SLAP Banner

SLAP

Structural Line Algorithm Path

Deterministic, zero-overhead context serialization and tree-state protocol.

License: MIT Format: SLAP Architecture: Zero--Overhead


Abstract

Modern data serialization formats (JSON, YAML, XML) carry massive historical ballast: redundant quotation marks, nested closing brackets, fragile indentation rules, and zero native support for state inheritance.

SLAP (Structural Line Algorithm Path) is an ultra-minimalist, line-deterministic protocol designed for pure efficiency. It maps hierarchical tree topologies and cascading context inheritance using single-character prefix vectors. No brackets, no commas, no syntax noise.


Core Principles

  1. Zero Syntax Overhead: Only semantic data and explicit prefix markers exist. Whitespace within identifiers is strictly prohibited (use _).
  2. Deterministic Single-Pass Parsing (O(N)): Evaluated strictly line-by-line using a lightweight state machine. No lookaheads, no backtrack buffers, no bracket-balancing.
  3. Cascading State Inheritance: Attributes defined at a higher node automatically cascade down through all subsequent child nodes until the context is explicitly reset by a new root entity.
  4. Visual Depth Indexing: Structural hierarchy is declared at index 0 of each line.

Syntax Specification

1. Entities & Objects (-, --, ---)

  • - declares a root entity (resets previous context).
  • Each additional - increases the hierarchical depth level ($N+1$).

2. Attributes & States (., .., ...)

  • . declares a globally inherited attribute for the current root branch.
  • .. declares a localized attribute bound strictly to the preceding sub-node.
  • Key-value pairs are delimited by a single colon (:).

Protocol Comparison

SLAP Representation

-cluster_alpha
.zone:eu_central
.security:strict
--node_01
--node_02
..role:backup
-cluster_beta
.zone:us_east
--node_03

Legacy JSON Representation

{
  "cluster_alpha": {
    "zone": "eu_central",
    "security": "strict",
    "nodes": [
      { "id": "node_01", "zone": "eu_central", "security": "strict" },
      { "id": "node_02", "zone": "eu_central", "security": "strict", "role": "backup" }
    ]
  },
  "cluster_beta": {
    "zone": "us_east",
    "nodes": [
      { "id": "node_03", "zone": "us_east" }
    ]
  }
}

Result: SLAP reduces character payload by over 50% while completely removing bracket-closure failure vectors.


Reference Implementation

The reference parser is provided in SLAP.py as a standalone, zero-dependency engine:

from SLAP import parse_slap

raw_slap_data = """
-alpha
.status:active
--beta
--gamma
..role:worker
-delta
.status:idle
--epsilon
"""

nodes = parse_slap(raw_slap_data)
for node in nodes:
    print(f"Path: {node['path']} | Attributes: {node['attributes']}")

License

This project is licensed under the MIT License - see the LICENSE file for details.

Developed as part of the Recursive-Logic-Core architecture framework.

Contributors

Languages

Python

100.0%