{"id":15049444,"url":"https://github.com/catseye/philomath","last_synced_at":"2025-04-10T02:22:42.270Z","repository":{"id":142239946,"uuid":"476855403","full_name":"catseye/Philomath","owner":"catseye","description":"MIRROR of https://codeberg.org/catseye/Philomath : An LCF-style theorem prover written in C89 (a.k.a ANSI C)","archived":false,"fork":false,"pushed_at":"2023-12-19T16:37:35.000Z","size":53,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T03:53:10.264Z","etag":null,"topics":["ansi-c","c89","lcf-style","natural-deduction","proof-checker","proof-checking","propositional-logic","theorem-prover","theorem-proving"],"latest_commit_sha":null,"homepage":"https://catseye.tc/node/Philomath","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catseye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-04-01T20:09:01.000Z","updated_at":"2024-08-25T20:01:13.000Z","dependencies_parsed_at":"2023-12-19T21:42:28.442Z","dependency_job_id":"373ffb9a-56c3-4392-9ea8-9f0f6e8f0a11","html_url":"https://github.com/catseye/Philomath","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FPhilomath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FPhilomath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FPhilomath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FPhilomath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catseye","download_url":"https://codeload.github.com/catseye/Philomath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143242,"owners_count":21054734,"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","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":["ansi-c","c89","lcf-style","natural-deduction","proof-checker","proof-checking","propositional-logic","theorem-prover","theorem-proving"],"created_at":"2024-09-24T21:20:31.001Z","updated_at":"2025-04-10T02:22:42.245Z","avatar_url":"https://github.com/catseye.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Philomath\n=========\n\nVersion 1.1 | _See also:_ [LCF-style-Natural-Deduction][]\n∘ [Maxixe](https://codeberg.org/catseye/Maxixe#maxixe)\n∘ [Cardboard Prolog](https://codeberg.org/catseye/Cardboard-Prolog#cardboard-prolog)\n\n- - - -\n\n**Philomath** is an LCF-style theorem prover written in ANSI C.  It implements\n[classical propositional logic][] inside a [Natural Deduction][] system with\nlabelled assumptions.  For more information on this approach, see the\n**[LCF-style-Natural-Deduction][]** article.\n\nHow do I write a proof with this?\n---------------------------------\n\nCreate a file `myproof.c`:\n\n```c\n#include \"formula.h\"\n#include \"proof.h\"\nint main(int argc, char **argv) {\n    /* Proof of p -\u003e p */\n    return proves(\n        impl_intro(1, suppose(var(\"p\"), 1)),\n        impl(var(\"p\"), var(\"p\"))\n    );\n}\n```\n\nThen compile and run it with:\n\n    ./build-proof.sh myproof\n\nAnd run the resulting executable:\n\n    ./myproof.exe\n\nIf the exit code is 0, the proof is valid!\n\n    % echo $?\n    0\n\nIf you wish to build the proof with debugging output, you can pass the `-D` flag:\n\n    ./build-proof.sh -D myproof\n\nLimitations\n-----------\n\nLCF-style theorem proving relies on data abstraction, i.e. information hiding.\nIn C, information hiding is accomplished by exposing, in a header file, only the\nfact that a `struct` exists, and *not* exposing its structure.  Client code can then\nwork with pointers to that `struct` without knowing what's contained in it.\n\nIt is however possible to subvert this mechanism.  If your proof code does any of\nthe following things, it is possible it is no longer a valid proof:\n\n*   includes the file `proof.c` directly, rather than including `proof.h`\n*   casts a `struct theorem` value to some other type\n*   casts a value of some other type to a `struct theorem`\n\nFortunately, it is possible to statically analyze a C source file and confirm\nthat it does none of these things, if such a level of assurance is desired.\n\nTODO\n----\n\nShould really have even more demo non-proofs, to help ensure that it's not\nletting non-proofs pass themselves off as proofs somewhere.\n\nHistory\n-------\n\n### 1.1\n\n*   When creating a `struct theorem` or `struct assumptions`, the\n    supplied `struct formula *` is now cloned (deep-copied) before being\n    stored in the structure.  This prevents the theorem from being\n    manipulated after its creation by updating the contents of the\n    `struct formula *` that was used to create it.  Thanks to\n    [Proloy Mishra](https://github.com/pro465) for pointing out this\n    hole.\n*   More test cases, and a driver script (`test.sh`) to run the tests.\n*   Added this \"History\" section to the README.\n\n### 1.0-2022.0905\n\n*   Renamed `struct theorem` to `struct proof`, and `proof.{c,h}` to\n    `theorem.{c,h}` to better reflect what these objects are.\n\n### 1.0\n\n*   Initial release of Philomath.\n\n[classical propositional logic]: https://iep.utm.edu/natural-deduction/#H4\n[Natural Deduction]: https://iep.utm.edu/natural-deduction/\n[LCF-style-Natural-Deduction]: https://codeberg.org/catseye/The-Dossier/src/branch/master/article/LCF-style-Natural-Deduction/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Fphilomath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatseye%2Fphilomath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Fphilomath/lists"}