{"id":13749206,"url":"https://github.com/salmans/rusty-razor","last_synced_at":"2025-04-13T02:12:35.673Z","repository":{"id":47170662,"uuid":"163569742","full_name":"salmans/rusty-razor","owner":"salmans","description":"Razor is a tool for constructing finite models for first-order theories","archived":false,"fork":false,"pushed_at":"2022-12-19T06:58:59.000Z","size":1347,"stargazers_count":55,"open_issues_count":20,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-22T21:35:05.334Z","etag":null,"topics":["chase","geometric-logic","model-finding","rust-lang","theorem-proving"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salmans.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":"2018-12-30T07:25:40.000Z","updated_at":"2023-03-07T22:20:29.000Z","dependencies_parsed_at":"2023-01-29T20:46:09.077Z","dependency_job_id":null,"html_url":"https://github.com/salmans/rusty-razor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmans%2Frusty-razor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmans%2Frusty-razor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmans%2Frusty-razor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmans%2Frusty-razor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salmans","download_url":"https://codeload.github.com/salmans/rusty-razor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654093,"owners_count":21140236,"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":["chase","geometric-logic","model-finding","rust-lang","theorem-proving"],"created_at":"2024-08-03T07:00:56.982Z","updated_at":"2025-04-13T02:12:35.634Z","avatar_url":"https://github.com/salmans.png","language":"Rust","funding_links":[],"categories":["Projects"],"sub_categories":["Libraries"],"readme":"# rusty-razor\n\nRusty Razor is a tool for constructing finite models for first-order theories. The model-finding algorithm is inspired\nby [the chase](https://en.wikipedia.org/wiki/Chase_(algorithm)) for database systems. Given a first-order theory,\nRazor constructs a set of *homomorphically minimal* models for the theory.\n\nCheck out Razor's [documentation](https://salmans.github.io/rusty-razor/intro.html) for more information about the project and introductory examples.\n\n## Build\n\nrusty-razor is written in Rust, so you will need [Rust](https://www.rust-lang.org) 1.48.0 or newer to compile it.\nTo build rusty-razor:\n\n```\ngit clone https://github.com/salmans/rusty-razor.git\ncd rusty-razor\ncargo build --release\n```\n\nThis puts rusty-razor's executable in `/target/release`.\n\n## Run\n\n### `solve`\n\nUse the `solve` command to find models for a theory written in an `\u003cinput\u003e` file:\n\n```\nrazor solve -i \u003cinput\u003e\n```\n\nThe `--count` parameter limits the number of models to construct:\n\n```\nrazor solve -i \u003cinput\u003e --count \u003cnumber\u003e\n```\n\n#### Bounded Model-Finding\n\nUnlike conventional model-finders such as [Alloy](http://alloytools.org), Razor doesn't require the user to provide a\nbound on the size of the models that it constructs. However, Razor may never terminate when running on theories with\nnon-finite models -- it can be shown that a run of Razor on an unsatisfiable theory (i.e., a theory with no models)\nis guaranteed to terminate (although it might take a very very long time).This is a direct consequence of\nsemi-decidability of first-order logic.\n\nTo guarantee termination, limit the size of the resulting models by the number of their elements using the `--bound`\noption with a value for the `domain` parameter:\n\n```\nrazor solve -i \u003cinput\u003e --bound domain=\u003cnumber\u003e\n```\n\n#### Model-Finding Scheduler\n\nUse the `--scheduler` option to choose how Razor processes search branches. The `fifo` scheduler (the default scheduler)\nschedules new branches last and is a more suitable option for processing theories with few small satisfying models.\nThe `lifo` scheduler schedules new branches first, and is more suitable for processing theories with many large models.\n\n```\nrazor solve -i \u003cinput\u003e --scheduler \u003cfifo/lifo\u003e\n```\n\n## Toy Example\n\nConsider the following example:\n\n```\n// All cats love all toys:\nforall c, t . (Cat(c) and Toy(t) implies Loves(c, t));\n\n// All squishies are toys:\nforall s . (Squishy(s) implies Toy(s));\n\nCat('duchess);   // Duchess is a cat\nSquishy('ducky); // Ducky is a squishy\n```\n\nYou can download the example file [here](https://github.com/salmans/rusty-razor/blob/master/theories/examples/toy.raz) and run the `razor` command-line tool on it:\n\n```\nrazor solve -i theories/examples/toy.raz\n```\n\nRazor returns only one model with `e#0` and `e#1` as elements that denote `'duchess` and\n`'ducky` respectively. The facts `Cat(e#0)`, `Squishy(e#1)`, and `Toy(e#1)` in the model\nare directly forced by the last two formula in the input theory. The fact `Loves(e#0, e#1)`\nis deduced by Razor:\n\n```\nDomain: e#0, e#1\n\nElements: 'duchess -\u003e e#0, 'ducky -\u003e e#1\n\nFacts: Cat(e#0), Loves(e#0, e#1), Squishy(e#1), Toy(e#1)\n```\n\nRazor's documentation describes the [syntax](https://salmans.github.io/rusty-razor/syntax.html)\nof Razor's input and contains more [examples](https://salmans.github.io/rusty-razor/example.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalmans%2Frusty-razor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalmans%2Frusty-razor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalmans%2Frusty-razor/lists"}