Skip to content

PEACEBINFLOW/law-n-nsql-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🟪 Law-N N-SQL Engine

Minimal execution engine for N-SQL (Network SQL) in the Law-N stack.

This is Repo #8 in the Law-N Part 3 rollout.

Where law-n-nsql-spec defines the language,
law-n-nsql-engine actually runs the queries.


What this repo does (now)

✅ Parses a small, practical subset of N-SQL:

  • SELECT ... FROM network.routes ...
  • SELECT ... FROM network.devices ...
  • OPTIMIZE ROUTE "A" TO "B" ...
  • INSPECT FREQUENCY 3.42GHz
  • INSPECT DEVICE "0xA4C1"

✅ Builds a simple AST (abstract syntax tree)
✅ Routes queries to dedicated executors
✅ Executes against an in-memory mock network adapter:

  • devices
  • towers
  • routes
  • frequencies

This is a reference engine for:

  • tower simulators
  • CLSI prototypes
  • network-native OS experiments
  • Law-N demos & visualizations

High-Level Architecture

N-SQL text
   ↓
 parser.py      → tokenizes and parses into AST
   ↓
 ast.py         → typed AST nodes (SelectQuery, OptimizeRoute, InspectQuery)
   ↓
 engine.py      → dispatches to executors
   ↓
 executors/     → select / optimize / inspect
   ↓
 adapters/      → in-memory mock network (later: CLSI, towers, devices)

About

Minimal execution engine for N-SQL — parses N-SQL queries, builds a simple AST, and executes them against pluggable network data adapters (mock/in-memory for now).

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages