{"id":15540324,"url":"https://github.com/rm-hull/ambages","last_synced_at":"2025-04-11T09:45:55.558Z","repository":{"id":145430897,"uuid":"63485218","full_name":"rm-hull/ambages","owner":"rm-hull","description":"A small prolog interpreter, implemented in Clojure.","archived":false,"fork":false,"pushed_at":"2018-10-06T11:42:11.000Z","size":817,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-03T12:18:02.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.destructuring-bind.org/ambages","language":"Clojure","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/rm-hull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-07-16T13:53:57.000Z","updated_at":"2020-11-11T13:49:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"51d496ec-7247-4002-bcca-2ff256b42d45","html_url":"https://github.com/rm-hull/ambages","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fambages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fambages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fambages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fambages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rm-hull","download_url":"https://codeload.github.com/rm-hull/ambages/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248369628,"owners_count":21092633,"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":[],"created_at":"2024-10-02T12:13:31.948Z","updated_at":"2025-04-11T09:45:55.550Z","avatar_url":"https://github.com/rm-hull.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ambages [am-BEY-jeez] noun, Archaic. _pl (plural only)_\n\n\u003e 1. Indirect or roundabount way of talking; circumlocution.\n\u003e 2. Indirect or roundabout routes or directions.\n\n[![Build Status](https://travis-ci.org/rm-hull/ambages.svg?branch=master)](http://travis-ci.org/rm-hull/ambages) \n[![Coverage Status](https://coveralls.io/repos/rm-hull/ambages/badge.svg?branch=master)](https://coveralls.io/r/rm-hull/ambages?branch=master) \n[![Dependencies Status](https://versions.deps.co/rm-hull/ambages/status.svg)](https://versions.deps.co/rm-hull/ambages) \n[![Downloads](https://versions.deps.co/rm-hull/ambages/downloads.svg)](https://versions.deps.co/rm-hull/ambages) \n[![Clojars Project](https://img.shields.io/clojars/v/rm-hull/ambages.svg)](https://clojars.org/rm-hull/ambages)\n[![Maintenance](https://img.shields.io/maintenance/yes/2018.svg?maxAge=2592000)]()\n\nA small prolog interpreter, based on a paper by **M. Nilsson**, _Uppsala University_,\nwhere the aim is to faithfully reproduce (at least initially) the same demonstrable\nfunctionality in Clojure.\n\n\u003e ### The world's shortest Prolog interpreter?\n\u003e **M. Nilsson**, _Uppsala University_\n\u003e\n\u003e The aim of this article is to describe a small structure-sharing Prolog interpreter\n\u003e which is implemented in LISP. It is easy to type in, fairly readable, and efficient\n\u003e enough to execute programs which are small and simple, yet not totally trivial.\n\u003e\n\u003e #### IMPLEMENTATION\n\u003e Admittedly, the title of this paper is a bit provocative. In fact, the interpreter\n\u003e can be made even smaller by replacing the selector and constuctor functions\n\u003e (which are there only for readability) with their respective CARs, CDRs, and\n\u003e CONSes, etc.\n\u003e\n\u003e To improve on the time/memory efficiency, the best suggestion is to optimise\n\u003e the variable binding scheme. In the version presented, linear list search is used\n\u003e for finding bindings of variables. The interpreter can be sped up by a factor of\n\u003e about 100 if instead some indexed data structure like an array is used (Nilsson,\n\u003e 1993). Unfortunately, in LISP such structures are often very implementation-dependent,\n\u003e so they have been avoided here.\n\u003e\n\u003e The interpreter is written in MACLISP dialect (Moon, 1974). Only the most basic\n\u003e functions are used, with the exceptions of LET and LOOP. LET is a convenient\n\u003e way of writing LAMBDAs...\n\nThe full text of the article can be found in the [included PDF](https://github.com/rm-hull/ambages/blob/master/doc/twspi.pdf).\n\n### Pre-requisites\n\nYou will need [Leiningen](https://github.com/technomancy/leiningen) 2.6.1 or above installed.\n\n### Building\n\nTo build and install the library locally, run:\n\n    $ cd ambages\n    $ lein test\n    $ lein install\n\n### Including in your project\n\nThere _will be_ a version hosted at [Clojars](https://clojars.org/rm-hull/ambages).\nFor leiningen include a dependency:\n\n```clojure\n[rm-hull/ambages \"0.1.0\"]\n```\n\nFor maven-based projects, add the following to your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003erm-hull\u003c/groupId\u003e\n  \u003cartifactId\u003eambages\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## API Documentation\n\nSee [www.destructuring-bind.org/ambages](http://www.destructuring-bind.org/ambages/) for API details.\n\n## Basic Usage\n\n\u003e TODO\n\n## References\n\n* http://dl.acm.org/citation.cfm?id=537885#\n* http://wiki.call-cc.org/eggref/4/tiny-prolog\n* http://www.lurklurk.org/clj_repl/clj_repl.html\n* http://strlen.com/bla/prolog.bla\n* http://cs.stackexchange.com/questions/6618/how-to-implement-a-prolog-interpreter-in-a-purely-functional-language\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Richard Hull\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fambages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frm-hull%2Fambages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fambages/lists"}