{"id":27433659,"url":"https://github.com/robsimmons/dusa","last_synced_at":"2025-04-14T17:17:26.552Z","repository":{"id":206443403,"uuid":"716651480","full_name":"robsimmons/dusa","owner":"robsimmons","description":"A logic programming language that has features of both Datalog and answer set programming.","archived":false,"fork":false,"pushed_at":"2025-04-04T15:34:51.000Z","size":3532,"stargazers_count":113,"open_issues_count":30,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-14T17:17:14.105Z","etag":null,"topics":["answer-set-programming","datalog","forward-chaining","logic-programming"],"latest_commit_sha":null,"homepage":"https://dusa.rocks","language":"TypeScript","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/robsimmons.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-09T15:27:52.000Z","updated_at":"2025-04-03T18:49:20.000Z","dependencies_parsed_at":"2023-11-28T23:28:56.532Z","dependency_job_id":"5301c761-d8b5-477f-ab2a-974834b67ff9","html_url":"https://github.com/robsimmons/dusa","commit_stats":null,"previous_names":["robsimmons/dusa"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robsimmons%2Fdusa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robsimmons%2Fdusa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robsimmons%2Fdusa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robsimmons%2Fdusa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robsimmons","download_url":"https://codeload.github.com/robsimmons/dusa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248923728,"owners_count":21183953,"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":["answer-set-programming","datalog","forward-chaining","logic-programming"],"created_at":"2025-04-14T17:17:25.789Z","updated_at":"2025-04-14T17:17:26.506Z","avatar_url":"https://github.com/robsimmons.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dusa Language\n\nDusa is an implementation of\n[finite-choice logic programming](https://arxiv.org/abs/2405.19040), which\ntakes ideas from logic programming in both Datalog and answer set programming.\n\n[![Run static checks](https://github.com/robsimmons/dusa/actions/workflows/check.yml/badge.svg)](https://github.com/robsimmons/dusa/actions/workflows/check.yml)\n[![Coverage Status](https://coveralls.io/repos/github/robsimmons/dusa/badge.svg?branch=main)](https://coveralls.io/github/robsimmons/dusa?branch=main)\n[![NPM Module](https://img.shields.io/npm/v/dusa.svg)](https://www.npmjs.com/package/dusa)\n\n- Dusa lives online at [dusa.rocks](https://dusa.rocks/).\n- Documentation lives at [dusa.rocks/docs](https://dusa.rocks/docs/)\n- [Source code on GitHub](https://github.com/robsimmons/dusa)\n- [Issue tracker at GitHub](https://github.com/robsimmons/dusa/issues)\n\nDusa was initially developed by Rob Simmons and Chris Martens while Rob\nattended [Recurse Center](https://www.recurse.com/) in Fall 2023. Recurse\nCenter is a great place to think about ambitious projects like this in a\nsupportive environment full of interesting people!\n\n## Command-line quickstart\n\nThe `dusa` command-line program can be run directly from\n[`npx`](https://docs.npmjs.com/cli/v8/commands/npx), the only requirement is\nthat you are using Node v22 or above. The examples used here can be found\n[on github](https://github.com/robsimmons/dusa/tree/main/examples).\n\nThe command-line utility requires one positional argument, a Dusa program, and\nif given no other arguments will return a single solution in JSON format.\n\n```\nnpx dusa examples/mutual-exclusion.dusa\n```\n\n\u003e **Potential gotcha:** if you literally download this repository and try to\n\u003e run this command, you'll get an error ERR_MODULE_NOT_FOUND, because `npx` is\n\u003e trying to run your local version of dusa instead of downloading it from the\n\u003e NPM registry. You can solve this either by deleting `package.json` (so `npx`\n\u003e doesn't get confused) or by running `npm i \u0026\u0026 npm run lib` (which builds the\n\u003e module that previously wasn't found).\n\nThe `-n` flag controls the number of solutions returned. This command will\nreturn 2 solutions:\n\n```\nnpx dusa examples/mutual-exclusion.dusa -n0\n```\n\nIncluding the `-q \u003cpred\u003e` flag will print only certain predicates instead of\nthe full database of facts.\n\n```\nnpx dusa examples/cky-parsing.dusa -n0 -q goal\nnpx dusa examples/character-creation.dusa -n3 -q a_story\nnpx dusa examples/rock-paper-scissors.dusa -n5 -q eventually\n```\n\nIncluding the `-c \u003cpred\u003e` flag will print only the number of facts about a\ncertain predicate that exist, instead of a list of all the values associated\nwith that fact.\n\n```\nnpx dusa examples/rock-paper-scissors.dusa -n3 -c move\nnpx dusa examples/rock-paper-scissors.dusa -n3 -c move -q eventually\n```\n\nYou can assert additional facts on the command line with `-a`. Adding two\nedges to the graph coloring example in examples/graph-coloring.dusa removes\nall solutions.\n\n```\nnpx dusa examples/graph-coloring.dusa -n5 -q isBlue\nnpx dusa examples/graph-coloring.dusa -n5 -q isBlue -a '{\"name\":\"edge\", \"args\":[{\"name\":\"a\"}, {\"name\":\"d\"}]}' -a '{\"name\":\"edge\", \"args\":[{\"name\":\"c\"}, {\"name\":\"d\"}]}'\n```\n\nThe `-f` option allows you to include files containing lists of JSON facts.\n\n```\nnpx dusa examples/canonical-reps.dusa -f examples/graph-data-32.json -q isRep\n```\n\n## License\n\nAll documentation and examples in the `docs` and `examples` directories and\nsubdirectories therein are MIT-licensed, but the Dusa implementation in\nJavaScript is, at present, only licensed under the GNU General Public License\nv3.0 (see LICENSE).\n\nDusa is presently under the GPL is to make it easy for many people to use the\nsoftware while maintaining some ownership of software that took a fair amount\nof time and expertise to develop. If the GPL is an issue for you or your\ncompany but you'd like to use it, I'd be delighted to discuss making that\npossible, and if you want to sponsor me to relicense Dusa more permissively,\nI wouldn't take _much_ convincing. --- Rob\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobsimmons%2Fdusa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobsimmons%2Fdusa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobsimmons%2Fdusa/lists"}