{"id":29627663,"url":"https://github.com/knuton/lox","last_synced_at":"2025-10-04T02:26:59.459Z","repository":{"id":9608068,"uuid":"11531523","full_name":"knuton/lox","owner":"knuton","description":"Think Markdown for logic formulas.","archived":false,"fork":false,"pushed_at":"2013-07-26T21:14:34.000Z","size":200,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-21T08:13:05.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knuton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-19T15:58:13.000Z","updated_at":"2013-07-26T21:14:34.000Z","dependencies_parsed_at":"2022-08-26T05:01:24.365Z","dependency_job_id":null,"html_url":"https://github.com/knuton/lox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/knuton/lox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knuton%2Flox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knuton%2Flox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knuton%2Flox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knuton%2Flox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knuton","download_url":"https://codeload.github.com/knuton/lox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knuton%2Flox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278254666,"owners_count":25956644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-21T08:05:37.112Z","updated_at":"2025-10-04T02:26:59.423Z","avatar_url":"https://github.com/knuton.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"lox\n===\n\nlox is a Haskell library for parsing logic formulas written in a simple\nhuman-readable language. It also has an accompanying executable `lox`, which\nwraps around [Pandoc](http://johnmacfarlane.net/pandoc/) to extend\n[Markdown](http://daringfireball.net/projects/markdown/) with inline formulas.\n\nBasic support has been implemented for\n\n- propositional logic,\n- first-order logic, and\n- modal logic.\n\nLanguage\n--------\n\nThe notation for formulas understood by lox is meant to be such that it can be\neasily written and read in a text editor, while being precise enough for strict\nanalysis and translation into different formats, most prominently LaTeX math\nexpressions. There are several possibilities for writing most logical operations,\nincluding Unicode characters.\n\nSome examples of formulas that would be processed by lox are `forall x. x=x`\n(equivalently `/\\x.x=x`), `p -\u003e q -\u003e p` and `[](p -\u003e q) =\u003e ([]p → []q)`.\n\nlox is unreasonably forgiving when parsing the language. If you use an identifier\nas both an object variable and a predicate variable, or mix modal and first-order\noperators, it will assume that you know what you are doing and happily parse it.\n\n### Terms\n\nAny upper- or lowercase letter can serve as an identifier for a variable or\nfunction. Below, `x` is any such letter, as is `f`, and `t1, ..., tn` are terms.\n\n```\nTerm ::= x ¦ f(t1, ..., tn) ¦ t1 + t2 ¦ t1 - t2 ¦ t1 * t2 ¦ t1 / t2\n```\n\n### Classical Logic\n\nAny upper- or lowercase letter can serve as a propositional letter or predicate\nsymbol. Below, `p` is any such letter, as is `P`, `t1, ..., tn` are terms, and `A`\n`B` are formulas.\n\n```\nAtom ::= p ¦ P(t1, ..., tn) ¦ t1 = t2 ¦ t1 /= t2\n```\n\n```\nNegation ::= ~A ¦ ¬A\n```\n\n```\nConjunction ::= A \u0026\u0026 B ¦ A \u0026 B ¦ A ∧ B\n```\n\n```\nDisjunction ::= A || B ¦ A | B ¦ A ∨ B\n```\n\n```\nImplication ::= A -\u003e B ¦ A =\u003e B ¦ A → B\n```\n\n```\nBiconditional ::= A \u003c-\u003e B ¦ A \u003c=\u003e B ¦ A ↔ B\n```\n\n```\nQuantification ::= forall x. A ¦ /\\x. A ¦ ∀x. A ¦ exists x. A ¦ \\/x. A ¦ ∃x. A\n```\n\n### Modal Logic\n\n```\nModal ::= []A ¦ ◻A ¦ □A ¦ \u003c\u003e A ¦ ⋄A ¦ ◊A ¦ ◇A ¦ ♢A\n```\n\n### Formulas\n\nA `Formula` is any of the above, i.e. any of `Atom`, `Negation`, `Conjunction`,\n`Disjunction`, `Implication`, `Biconditional`, `Quantification`, or `Modal`.\n\nDocuments\n---------\n\nWhen using `lox`, you can put inline formula statements in your document in between\ntwo `§` characters. For example, if you run this very document through `lox`, the\nformula §forall x. forall y. x = y | x /= y§ will be parsed and translated into a\n\"proper\" formula. More precisely, it would be rewritten as an inline math expression,\n$\\forall x.\\forall y. x = y \\vee x \\not= y$, before the document would go through\nPandoc's processing.\n\nAs with formulas itself, `lox` is very forgiving with documents. If it can not\nsuccessfully process some formula, it will leave it unchanged and process only the\nremaining formulas. If it fails on the whole document, it will just pass it on to\nPandoc without any changes.\n\nSince `lox` is only a slight modification of the regular `pandoc` executable, it can\nbe used in the very same way.\n\nModule Dependencies\n-------------------\n\n- pandoc (1.11.1)\n\nCopyright\n---------\n\n(C) 2013 Johannes Emerich\n\nFor licensing, see `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknuton%2Flox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknuton%2Flox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknuton%2Flox/lists"}