Browser-based inductive logic programming using Popper's Alan ASP encoding, Clingo WASM, and Trealla Prolog.
npm install
npm startOpen http://localhost:3000 (or whatever serve prints). Use Load example → grandparent-maternal, then Induce.
Static app — no backend. LLM keys stay in the browser; Clingo WASM and Trealla load from CDN.
# first time only
wrangler pages project create webilp --production-branch main
# deploy
wrangler pages deploy . --project-name webilp --branch main- Production URL: https://webilp.pages.dev
- Custom domain (once added in Cloudflare): https://app.livelogic.dev
wrangler.toml and .assetsignore are in the repo root. node_modules/ is not uploaded.
livelogic.dev is on Cloudflare. Custom domain is registered on the webilp Pages project.
If status is pending / “CNAME record not set”, add in DNS for livelogic.dev:
| Type | Name | Content | Proxy |
|---|---|---|---|
| CNAME | app | webilp.pages.dev |
ON |
Then in Workers & Pages → webilp → Custom domains, confirm app.livelogic.dev is active.
- Paste or import Popper layer files:
bk.pl,bias.pl,exs.pl - Or import folder — pick a directory containing those three files
- Induce — Clingo enumerates candidate rules; Trealla tests them on your examples
- Build encoding — preview the full Alan → ASP program sent to Clingo
Configure LLM settings at the top of the page:
| Preset | Base URL | Model |
|---|---|---|
| OpenRouter free router (default) | https://openrouter.ai/api/v1 |
openrouter/free |
| OpenRouter Gemma free | same | google/gemma-2-9b-it:free |
| OpenAI | https://api.openai.com/v1 |
gpt-4o-mini |
| Custom | your gateway | your model slug |
Free models: OpenRouter’s openrouter/free router picks a free model automatically. You still need an API key (openrouter.ai/keys) — inference is free, not keyless. OpenRouter supports browser CORS.
Settings (including API key) are stored in localStorage only — never sent anywhere except your chosen API endpoint.
Source text examples (dropdown in LLM assist): kinship-maternal, kinship-royal, craft-economy under examples/source-texts/.
- Draft Popper layer — LLM fills
bk.pl,bias.pl,exs.plfrom a domain description → Induce - Extract facts → bk — LiveKnowledge-style: LLM proposes ASP, Clingo WASM verifies
bk ⊕ candidateis satisfiable, then merges into bk - Suggest more examples — LLM appends
pos/negtoexs.pl
This mirrors LiveKnowledge v2.1 (generate_knowledge + verify_candidate_knowledge) in the browser, then adds Popper induction on top.
| Feature | In browser | Full Popper CLI |
|---|---|---|
Single-clause rules (alan.pl) |
yes | yes |
max_clauses > 1, enable_pi, enable_recursion |
no (WASM uses alan.pl only) |
yes (alan-old.pl) |
| Learning from failures / nogoods | no (enumerate + test) | yes |
For marbles-style layers with PI or recursion, run helpers/induce.sh in the target repo.
vendor/popper/ alan.pl, alan-old.pl, test.pl (from Popper)
js/ bias parser, encoding builder, induction loop
examples/ sample Popper layers
npm run test:induceUses the grandparent-maternal example (expects a perfect single-clause solution).