# PocketLearn **Symbolic cognitive architecture: XML + XSLT + ILP + ASP + FORTH. Zero Python.** Learn = build a visible theory. Neural net: `learn = adjust W -= lr * grad`. Knowledge disappears into numbers you can't read. This: `learn = build a visible theory.` --- ## What it does ``` sample_corpus.txt | v corpus_tokens.xml (tokenizer — 69 tokens, 52 vocab) | v ontology.xml (seed concepts: stack_op, compiler_word, meta_word...) | +--[XSLT]----------> background.pl (Prolog co-occurrence facts) | +--[XSLT]----------> ontology_induction_generated.pl (ILP engine, GENERATED by XSLT) | v swipl learns rules: Induced: is_a(W, stack_op) :- cooccur(W, 'drop'). F1=0.60 Propose: include should be is_a(stack_op) cnt=1 | v ontology_induced.xml (updated ontology with induced members) | +------[XSLT]-+------[XSLT]--+ | | v v ASP validation generated_corpus_induced.fth clingo rejects gforth runs the learned dictionary contradictions (dup = stack_op AND compiler_word -> UNSAT) ``` **The meta-trick:** `ontology_to_induction.xslt` generates the Prolog ILP engine from `ontology.xml`. So the whole system is self-describing — XSLT generates Prolog that learns rules from XML co-occurrence stats. --- ## Run ```bash # Install (Mac) brew install libxslt swi-prolog clingo gforth # Install (Linux) sudo apt install -y xsltproc swi-prolog gringo gforth # Build — full pipeline make # Run the FORTH (pre-built, no deps needed) make demo-prebuilt ``` --- ## What you get ```bash make # [3/7] ILP engine via XSLT # [4/7] ILP Induction # Induced: is_a(W, stack_op) :- cooccur(W, 'drop'). F1=0.60 # Induced: is_a(W, compiler_word) :- cooccur(W, 'semicolon'). F1=0.75 # Induced: is_a(W, learning_word) :- cooccur(W, 'statistical'). F1=0.80 # Proposing: include should be is_a(stack_op) (cooccurs with 'drop') # Proposing: defined should be is_a(compiler_word) (cooccurs with 'semicolon') # Proposing: similarity should be is_a(learning_word) # [5/7] ASP: SATISFIABLE # [6/7] FORTH written make demo # PocketLearn FORTH — seed + ILP-induced vocab # vocab size: 18 # Induced: include (by drop), defined (by semicolon), similarity (by statistical) ``` --- ## Files | File | Role | |------|------| | `sample_corpus.txt` | Input text | | `corpus_tokens.xml` | Tokenized corpus (XML) | | `ontology.xml` | Seed concepts with members + co-occurrence strengths | | `ontology_induced.xml` | Output ontology with ILP-induced members | | `corpus_to_background.xslt` | XML → Prolog co-occurrence facts | | `ontology_to_induction.xslt` | **Generates** the Prolog ILP engine from ontology.xml | | `ontology_to_asp.xslt` | XML → ASP validation facts | | `corpus_to_forth.xslt` | XML → FORTH dictionary | | `ontology_induction_generated.pl` | ILP engine (XSLT output) — run with swipl | | `generated_corpus_induced.fth` | Final FORTH (seed + induced) — run with gforth | | `ontology.asp` | ASP contradiction rules | | `Makefile` | Full pipeline | --- ## Why this instead of a transformer | | Transformer | PocketLearn | |--|--|--| | Inspectable | No — weights are numbers | Yes — open `ontology_induced.xml` | | Reproducible | No — depends on random seed | Yes — same XML = same FORTH, bit-for-bit | | Debuggable | No | Yes — stack blow → trace to corpus_tokens.xml line → XSLT template | | Hallucinates | Yes — `dup = delete` possible | No — ASP kills contradictions | | Learns deep semantics | Yes | No | It won't discover deep semantics. It will never hallucinate `dup = delete` because ASP kills it. --- **Ahmad Ali Parr · Bel Esprit D'Accord Irrevocable Trust · EIN 42-697643** `Omega = TRUST AND CODE`