{"id":13749215,"url":"https://github.com/joshrule/term-rewriting-rs","last_synced_at":"2026-03-17T22:04:52.196Z","repository":{"id":57669521,"uuid":"124265607","full_name":"joshrule/term-rewriting-rs","owner":"joshrule","description":"a Rust implementation of first-order term rewriting systems (TRS)","archived":false,"fork":false,"pushed_at":"2021-12-28T23:16:18.000Z","size":817,"stargazers_count":28,"open_issues_count":19,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-13T23:17:56.485Z","etag":null,"topics":["rewriting","rust","rust-library","term-rewriting"],"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/joshrule.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-03-07T16:45:53.000Z","updated_at":"2025-09-06T07:31:34.000Z","dependencies_parsed_at":"2022-09-26T20:40:57.261Z","dependency_job_id":null,"html_url":"https://github.com/joshrule/term-rewriting-rs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/joshrule/term-rewriting-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshrule%2Fterm-rewriting-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshrule%2Fterm-rewriting-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshrule%2Fterm-rewriting-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshrule%2Fterm-rewriting-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshrule","download_url":"https://codeload.github.com/joshrule/term-rewriting-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshrule%2Fterm-rewriting-rs/sbom","scorecard":{"id":534274,"data":{"date":"2025-08-11","repo":{"name":"github.com/joshrule/term-rewriting-rs","commit":"250ed32a0283e2bf7aa481115d8c207da1b312cc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/24 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T06:32:25.908Z","repository_id":57669521,"created_at":"2025-08-20T06:32:25.908Z","updated_at":"2025-08-20T06:32:25.908Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30633240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["rewriting","rust","rust-library","term-rewriting"],"created_at":"2024-08-03T07:00:57.138Z","updated_at":"2026-03-17T22:04:52.179Z","avatar_url":"https://github.com/joshrule.png","language":"Rust","funding_links":[],"categories":["Projects"],"sub_categories":["Libraries"],"readme":"# [term-rewriting-rs][0]\n\n[![Travis-CI.org](https://img.shields.io/travis/joshrule/term-rewriting-rs.svg?maxAge=3600)](https://travis-ci.org/joshrule/term-rewriting-rs)\n[![Crates.io](https://img.shields.io/crates/v/term_rewriting.svg?maxAge=3600)](https://crates.io/crates/term_rewriting)\n[![Codecov](https://img.shields.io/codecov/c/github/joshrule/term-rewriting-rs.svg?maxAge=3600)](https://codecov.io/gh/joshrule/term-rewriting-rs)\n[![docs.rs](https://docs.rs/term_rewriting/badge.svg)](https://docs.rs/term_rewriting)\n\nA [Rust][1] library for representing, parsing, and computing with first-order [term rewriting systems][2].\n\n## Usage\n\nTo include as a dependency:\n\n```toml\n[dependencies]\nterm_rewriting = \"0.7\"\n```\n\nTo actually make use of the library:\n\n```rust\nextern crate term_rewriting;\nuse term_rewriting::{Signature, Term, parse_trs, parse_term};\n\nfn main() {\n    // We can parse a string representation of SK combinatory logic,\n    let mut sig = Signature::default();\n    let sk_rules = \"S x_ y_ z_ = (x_ z_) (y_ z_); K x_ y_ = x_;\";\n    let trs = parse_trs(\u0026mut sig, sk_rules).expect(\"parsed TRS\");\n\n    // and we can also parse an arbitrary term.\n    let mut sig = Signature::default();\n    let term = \"S K K (K S K)\";\n    let parsed_term = parse_term(\u0026mut sig, term).expect(\"parsed term\");\n\n    // These can also be constructed by hand.\n    let mut sig = Signature::default();\n    let app = sig.new_op(2, Some(\".\".to_string()));\n    let s = sig.new_op(0, Some(\"S\".to_string()));\n    let k = sig.new_op(0, Some(\"K\".to_string()));\n\n    let constructed_term = Term::Application {\n        op: app,\n        args: vec![\n            Term::Application {\n                op: app,\n                args: vec![\n                    Term::Application {\n                        op: app,\n                        args: vec![\n                            Term::Application { op: s, args: vec![] },\n                            Term::Application { op: k, args: vec![] },\n                        ]\n                    },\n                    Term::Application { op: k, args: vec![] }\n                ]\n            },\n            Term::Application {\n                op: app,\n                args: vec![\n                    Term::Application {\n                        op: app,\n                        args: vec![\n                            Term::Application { op: k, args: vec![] },\n                            Term::Application { op: s, args: vec![] },\n                        ]\n                    },\n                    Term::Application { op: k, args: vec![] }\n                ]\n            }\n        ]\n    };\n\n    // This is the same output the parser produces.\n    assert_eq!(parsed_term, constructed_term);\n}\n```\n\n## Term Rewriting Systems\n\nTerm Rewriting Systems (TRS) are a simple formalism from theoretical computer science used to model the behavior and evolution of tree-based structures like natural langauge parse trees or abstract syntax trees.\n\nA TRS is defined as a pair _(S, R)_. _S_ is a set of symbols called the signature and together with a disjoint and countably infinite set of variables, defines the set of all possible trees, or terms, which the system can consider. _R_ is a set of rewrite rules. A rewrite rule is an equation, _s = t_, and is interpreted as follows: any term matching the pattern described by _s_ can be rewritten according to the pattern described by _t_. Together _S_ and _R_ define a TRS that describes a system of computation, which can be considered as a sort of programming language. term-rewriting-rs provides a way to describe arbitrary first-order TRSs (i.e. no λ-binding in rules).\n\n### Further Reading\n\n- Baader \u0026 Nipkow (1999). [Term rewriting and all that][ref.1]. Cambridge University Press.\n- Bezem, Klop, \u0026 de Vrijer (Eds.) (2003). [Term Rewriting Systems][ref.2]. Cambridge University Press.\n- [Rewriting][ref.3]. (2017). Wikipedia.\n\n[0]: https://github.com/joshrule/term-rewriting-rs\n     \"term-rewriting-rs\"\n[1]: https://www.rust-lang.org\n     \"The Rust Programming Language\"\n[2]: https://en.wikipedia.org/wiki/Rewriting#Term_rewriting_systems\n     \"Wikipedia - Term Rewriting Systems\"\n[ref.1]: http://www.cambridge.org/us/academic/subjects/computer-science/programming-languages-and-applied-logic/term-rewriting-and-all\n     \"Term Rewriting and All That\"\n[ref.2]: http://www.cambridge.org/us/academic/subjects/computer-science/programming-languages-and-applied-logic/term-rewriting-systems\n     \"Term Rewriting Systems\"\n[ref.3]: https://en.wikipedia.org/wiki/Rewriting\n     \"Wikipedia - Rewriting\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshrule%2Fterm-rewriting-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshrule%2Fterm-rewriting-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshrule%2Fterm-rewriting-rs/lists"}