Native Shell
Native Shell은 모든 플랫폼의 앱 안에서 만들어지는 AI UI입니다
Logical English 2: 컴퓨터가 실행·설명하는 영문 규칙·계약·규정. 모든 답변에 이유·테스트·인용·다섯 언어 포함
Logical English 2: rules, contracts and regulations written in English that a computer runs and explains. Every answer with its reasons, tests inside the program, citations, views, five languages. Rea
개발 도구Prolog · TypeScriptGitHub @LogicalContractsOrg온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Logical English 2: rules, contracts and regulations written in English that a computer runs and explains. Every answer with its reasons, tests inside the program, citations, views, five languages. Reads twelve other rule languages (LegalRuleML, s(CASP), Blawx, L4, Drools, Solidity, Daml, Miniscript…). Try it in your browser.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Logical English (LE) is a controlled natural language for legal and business logic. It allows experts to write executable rules that look like plain English, which are then automatically translated into formal logic (Prolog) for reasoning and explanation.
LE 2.0 is a modernized, high-performance implementation of the original Logical English project.
Logic Production Systems, the sister system for rules about time and change — contracts, processes, agents — runs programs written in Logical English: LogicalContractsOrg/lps2, live at lps2.logicalcontracts.com.
Logical English reads the programs of twelve other rule systems. The
translations of their published examples, with the sources, the tests and a
ledger of what was and was not carried over, are in
examples/migration/; the translators
themselves are the Logical English Translators,
a licensed product of Logical Contracts. The
same licence gives the LE Contract Assistant, which writes the first draft of a
program from a contract, its schedules and its cases
(the assistants).
Logical English is designed to be readable by non-programmers while remaining mathematically precise.
*a person* acquires British citizenship on *a date*).if, and, or.Language reference | Tutorial | All documentation | Examples
The LE 2.0 environment provides a powerful, web-based IDE for developing and testing logic:
Using the editor | Architecture | Debugger | LE Assistant
You can configure the deployment using the following environment variables:
NO_RESTRICTIONS: Set to true to lift every licence restriction: the example trees (restricted_paths.pl), the translators of other systems, the LE Contract Assistant and the InsurLE extensions (le_entitlements.pl). For a development machine.LPS_PLUS_DIR: Where the private lpsPlus repository is — the sign-in, the licences table and the translators of other systems (le_plus.pl). By default ../lpsPlus, then /lpsPlus, then vendor/lpsplus (what vendor_lpsplus.sh copies for the image, and what the Dockerfile names). none behaves as if there were no lpsPlus: every visitor is anonymous.LC_AUTH_SECRET, LC_AUTH_COOKIE_DOMAIN, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET: the sign-in shared with the LPS server (Google, GitHub, or a password account we created). Set as fly.io secrets; lpsPlus accounts/README.md says how to obtain each one. What each licence adds: Signing in, and what a licence adds.ALLOWED_LE_EXPORTS: Comma-separated directories whose examples the /source/ endpoint may serve (fly.toml sets examples/moreExamples).LE_STATIC_EXPORT: Set to 1 when the server is being copied rather than used: the server-rendered pages then leave out the login link and the button that runs the test suite, which a static copy cannot honour. wasm/build.sh sets it while it fetches those pages for the WebAssembly build (docs/dev/deploy-vercel.md).OPENAI_API_KEY: API key for OpenAI models.ANTHROPIC_API_KEY: API key for Anthropic models.GEMINI_API_KEY, GOOGLE_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY: API key for Google Gemini models.GROQ_API_KEY: API key for Groq models.TOGETHER_API_KEY, TOGETHERAI_API_KEY: API key for Together AI models.LE_CONTRACT_JOBS_DIR: where the Contract Assistant keeps its jobs (default ).To run Logical English 2.0 on your local machine:
swipl:latest).git clone https://github.com/LogicalContractsOrg/LogicalEnglish2.git
cd LogicalEnglish2
swipl -g "use_module(classic_web_api), start_api_server(3050)"
The landing page is at http://localhost:3050/ and the editor at http://localhost:3050/editor/.
The editor's bundles (editor/dist/) are committed, so Node.js is only needed to rebuild them (editor/README.md).Optional components:
swipl -g "pack_install(scasp)" enables the s(CASP) engine (le_scasp.pl).npm install -g opencode-ai mcp-remote (docs/dev/assistant.md).the target language is: lps. run on an LPS2 server beside this one.le_extensions.pl, when present next to le_kbs.pl, adds the InsurLE constructs of docs/user/reference/extensions.md; le_importers.pl, likewise a link into the private lpsPlus repository, adds the Logical English Translators, the importers and exporters of other systems.The quickest way to run everything is the aggregate runner in testing/
(it always runs from the repo root, regardless of your current directory):
testing/run_tests.sh # run all suites and report a combined pass/fail
testing/run_tests.sh --no-e2e # skip the browser tests (fast: unit + LE examples)
testing/run_tests.sh unit # only the Prolog plunit suite
testing/run_tests.sh le # only the Logical English example tests (core)
testing/run_tests.sh e2e # only the Playwright browser tests
testing/run_tests.sh --with-extensions # LE examples incl. extension-dependent trees
testing/run_tests.sh le --with-extensions # ... just that suite
It exits non-zero if any suite that ran failed. The Playwright suite is skipped
(not failed) when its prerequisites are missing, unless CI is set. Override the
interpreter with SWIPL=/path/to/swipl testing/run_tests.sh.
The Logical English example suite comes in two variants:
| suite | what it runs | when |
|---|---|---|
| core (default) | Every example that runs on this repository alone. | Gate CI on this. It is the suite a clean checkout can make green. |
all (--with-extensions) | core, plus the example trees that need the proprietary le_extensions.pl — a symlink into a sibling repository. | Only when those extensions are installed. |
The extension-dependent programs use constructs the core grammar does not
implement, so without le_extensions.pl they do not merely fail — they cannot be
parsed, and their failures say nothing about core LE. That is why they are not in
the default suite.
The exclusion is a hardwired table, extension_dependent_path_fragment/1 in
le_kbs.pl (currently the insureLE2/, InsurLE2/ and lpsPlus/ example trees). Add a row
there when a new extension-dependent tree appears; nothing else changes.
Each variant writes its own status snapshot, and neither run touches the other's:
| suite | status file | |
|---|---|---|
| core | testSuiteCoreStatus.txt | reproducible from a clean checkout |
| all | testSuiteStatus.txt | needs le_extensions.pl to mean anything |
Both are tracked here. A repository that does not have the extensions should
ignore testSuiteStatus.txt — it cannot reproduce it — and read
testSuiteCoreStatus.txt instead. Each file's header names the suite it ran, when,
and the sibling file, so opening the wrong one tells you where the other is. Both
are snapshots of a single run, not curated baselines: to gate CI, use the exit
status of testing/run_tests.sh.
testing/run_tests.sh unit loads every testing/test_*.pl and runs
them together; one file alone runs with swipl -q -g run_tests -t halt testing/test_session_reaper.pl.swipl -g "use_module(le_kbs), runTests, halt."
runs the core suite; runAllTests (equivalently runTests(all)) adds the
extension-dependent trees. Each refreshes its own status file. Expectations live
inside each scenario as <query> expects answers [...] and unknowns [...];
sibling .le.tests files are deprecated — still read if present, but none remain
in the corpus and new examples must not add them.cd editor
npm install
npm run build
npm run test:e2e
To run tests visibly, use npm run test:e2e -- --headed or npx playwright test --ui.The Dockerfile builds an image with SWI-Prolog, the s(CASP) pack, Node.js, opencode and mcp-remote, and builds the editor:
docker build -t le2 .
docker run -p 3050:3050 le2
The editor will be available at http://localhost:3050/editor/.
The public deployment runs on fly.io (fly.toml): buildPush.sh builds the image from a copy of the tree with symlinks dereferenced (so the proprietary extensions and examples are included) and runs fly deploy --local-only. API keys are set as fly secrets.
There is a second deployment, which needs no container and no server at all:
wasm/build.sh turns LE2 into a directory of static files, with SWI-Prolog
compiled to WebAssembly and running in the visitor's own tab. Both deployments
answer the same operations — le_api.pl, which has no transport in it — so an
operation is implemented once.
./wasm/build.sh # → wasm/dist/
node wasm/runtime/serve.mjs wasm/dist 8080 # → http://localhost:8080/
cd wasm/dist && vercel deploy --prod # or any static host
What it can and cannot do (no assistants, no debugger, no accounts, no HTTP API), and how to deploy it: docs/dev/deploy-vercel.md.
LE 2.0 is built on SWI-Prolog for the reasoning engine and TypeScript/Monaco for the frontend.
POST /leapi, a JSON API (one operation per request) for loading programs, running queries and using every feature of the editor./mcp, for the Model Context Protocol, with REST equivalents, so LLM clients can verify and query programs./dap, over a WebSocket.Architecture | Web API | MCP | Developer documentation
Done (formerly on this list): the LLM assistants (LE Assistant, light and deep; Contract Assistant; "Write it in English…"); calling across LE files (included resources, lib/ libraries); Prolog resources and embedded prolog goals; dates and durations (lib/temporal.le); the step-by-step debugger over DAP; s(CASP) and LPS execution targets; global constants (definite descriptions, defines global); the proprietary extension hook (le_extensions.pl); contextual help in the editor (a ? on each panel, diagnostics linking to where they are explained).
Open:
All software in this repository is licensed under the Apache License 2.0 except where noted: the NOTICE file lists the parts written by others, which keep their own copyright and licence (libraries bundled in the editor, and the programs and texts of other systems among the examples).
Copyright holders by country:
Special thanks to: Andrew Noble, John Cummins, Chris and Bruce Mennell, Galileo Sartor and Faramarz Farhoodi.
For the legacy implementation and historical context, visit the original Logical English repository.
contract_jobs/LE_MODEL_PRICES_URL, LE_MODEL_PRICES_FILE, LE_MODEL_PRICES_CACHE: where the LLM price table for cost estimates comes from (default: LiteLLM's table on GitHub, cached in tmp/model_prices.json).LE_SENTRY_DSN, LE_CLOUDFLARE_ANALYTICS_TOKEN (and LE_SENTRY_ENVIRONMENT, LE_SENTRY_RELEASE): error reports to Sentry, with a feedback form, and Cloudflare Web Analytics; off unless set, and set (as fly secrets) only on the deployed server. See docs/dev/telemetry.md.