{"id":20660989,"url":"https://github.com/liatemplates/curiosity-prolog","last_synced_at":"2026-03-12T14:20:51.693Z","repository":{"id":107256831,"uuid":"123973759","full_name":"LiaTemplates/Curiosity-Prolog","owner":"LiaTemplates","description":"Template for the JavaScript Prolog-Interpreter https://curiosity-driven.org","archived":false,"fork":false,"pushed_at":"2019-05-21T11:11:46.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T12:16:34.398Z","etag":null,"topics":["liascript","liascript-template","macro","online-course","prolog","prolog-tutorial"],"latest_commit_sha":null,"homepage":"https://liascript.github.io/course/?https://raw.githubusercontent.com/liaTemplates/Curiosity-Prolog/master/README.md","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiaTemplates.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-05T20:20:22.000Z","updated_at":"2022-02-22T11:11:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"57f133a6-5660-4426-9dde-c275e7e29cbc","html_url":"https://github.com/LiaTemplates/Curiosity-Prolog","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/LiaTemplates%2FCuriosity-Prolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiaTemplates%2FCuriosity-Prolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiaTemplates%2FCuriosity-Prolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiaTemplates%2FCuriosity-Prolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiaTemplates","download_url":"https://codeload.github.com/LiaTemplates/Curiosity-Prolog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242788055,"owners_count":20185209,"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":["liascript","liascript-template","macro","online-course","prolog","prolog-tutorial"],"created_at":"2024-11-16T19:06:44.134Z","updated_at":"2026-03-12T14:20:46.669Z","avatar_url":"https://github.com/LiaTemplates.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\nauthor:   André Dietrich\nemail:    andre.dietrich@ovgu.de\nversion:  0.0.2\nlanguage: en\nnarrator: US English Female\n\nscript:   https://curiosity-driven.github.io/prolog-interpreter/parser.js\n          https://curiosity-driven.github.io/prolog-interpreter/interpreter.js\n\n@Prolog.db\n\u003cscript\u003e\nvar rules = parser(lexer(`@input`)).parseRules();\nwindow['@0'] = new Database(rules);\n\"database \" + \"@0\" + \" loaded\";\n\u003c/script\u003e\n@end\n\n@Prolog.shell\n\u003cscript\u003e\nvar rslt = \"\";\nvar goal = parser(lexer(`@input`)).parseTerm();\nfor (var item of window['@0'].query(goal)) {\n    rslt += \"Yes: \" + item + \"\\n\";\n}\nif (rslt === \"\") {\n   'No';\n} else {\n   rslt;\n}\n\u003c/script\u003e\n@end\n\n@Prolog.ui\n```prolog\n@2\n```\n@Prolog.db(@0)\n\n\n```prolog\n@1\n```\n@Prolog.shell(@0)\n@end\n--\u003e\n\n# Curiosity-Prolog - Template\n\n                         --{{0}}--\nThis document defines some basic macros for applying the JavaScript\nProlog-Interpreter https://curiosity-driven.org/prolog-interpreter interpreter\nin [LiaScript](https://LiaScript.github.io) to make Prolog programs in Markdown\nexecuteable and editable.\n\n__Try it on LiaScript:__\n\nhttps://liascript.github.io/course/?https://raw.githubusercontent.com/liaTemplates/curiosity-prolog/master/README.md\n\n__See the project on Github:__\n\nhttps://github.com/liaTemplates/curiosity-prolog\n\n                         --{{1}}--\nThere are three ways to use this template. The easiest way is to use the\n`import` statement and the URL of the raw text-file of the master branch or any\nother branch or version. But you can also copy the required functionality\ndirectly into the header of your Markdown document, see therefor the\n[last slide](#4). And of course, you could also clone this project and change\nit, as you wish.\n\n    {{1}}\n1. Load the macros via\n\n   `import: https://raw.githubusercontent.com/liaTemplates/curiosity-prolog/master/README.md`\n\n2. Copy the definitions into your Project\n\n3. Clone this repository on GitHub\n\n## `@Prolog.db` \u0026 `@Prolog.shell`\n\n```prolog\nmother_child(trude, sally).\n\nfather_child(tom, sally).\nfather_child(tom, erica).\nfather_child(mike, tom).\n\nsibling(X, Y)      :- parent_child(Z, X), parent_child(Z, Y).\n\nparent_child(X, Y) :- father_child(X, Y).\nparent_child(X, Y) :- mother_child(X, Y).\n```\n@Prolog.db(family.pro)\n\n\n** Queries **\n\n```prolog\nsibling(sally, erica).\n```\n@Prolog.shell(family.pro)\n\n\n## `@Prolog.ui`\n\n\n\n```prolog @Prolog.ui(db_full_etc,`sibling(sally, erica).`)\nmother_child(trude, sally).\n\nfather_child(tom, sally).\nfather_child(tom, erica).\nfather_child(mike, tom).\n\nsibling(X, Y)      :- parent_child(Z, X), parent_child(Z, Y).\n\nparent_child(X, Y) :- father_child(X, Y).\nparent_child(X, Y) :- mother_child(X, Y).\n```\n\n## Implementation\n\n                         --{{0}}--\nThe code shows how the macros were implemented. If you want to use a fully\nfunctional Prolog implementation for your course, see the more mature\n[Tau-Prolog](https://github.com/liaTemplates/tau-prolog).\n\n\n````js\nscript:   https://curiosity-driven.github.io/prolog-interpreter/parser.js\n          https://curiosity-driven.github.io/prolog-interpreter/interpreter.js\n\n@Prolog.db\n\u003cscript\u003e\nvar rules = parser(lexer(`@input`)).parseRules();\nwindow['@0'] = new Database(rules);\n\"database \" + \"@0\" + \" loaded\";\n\u003c/script\u003e\n@end\n\n@Prolog.shell\n\u003cscript\u003e\nvar rslt = \"\";\nvar goal = parser(lexer(`@input`)).parseTerm();\nfor (var item of window['@0'].query(goal)) {\n    rslt += \"Yes: \" + item + \"\\n\";\n}\nif (rslt === \"\") {\n   'No';\n} else {\n   rslt;\n}\n\u003c/script\u003e\n@end\n\n@Prolog.ui\n```prolog\n@2\n```\n@Prolog.db(@0)\n\n\n```prolog\n@1\n```\n@Prolog.shell(@0)\n@end\n````\n\n                         --{{1}}--\nIf you want to minimize loading effort in your LiaScript project, you can also\ncopy this code and paste it into your main comment header, see the code in the\nraw file of this document.\n\n{{1}} https://raw.githubusercontent.com/liaTemplates/curiosity-prolog/master/README.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliatemplates%2Fcuriosity-prolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliatemplates%2Fcuriosity-prolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliatemplates%2Fcuriosity-prolog/lists"}