{"id":26331475,"url":"https://github.com/sasagawa888/elxlog","last_synced_at":"2025-03-15T22:37:32.174Z","repository":{"id":57494993,"uuid":"200460593","full_name":"sasagawa888/Elxlog","owner":"sasagawa888","description":"Prolog interpreter/compiler","archived":false,"fork":false,"pushed_at":"2020-06-15T23:10:19.000Z","size":183,"stargazers_count":32,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-16T00:24:30.797Z","etag":null,"topics":["elixir","prolog"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sasagawa888.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-04T07:00:38.000Z","updated_at":"2025-01-08T18:23:54.000Z","dependencies_parsed_at":"2022-08-28T19:40:38.093Z","dependency_job_id":null,"html_url":"https://github.com/sasagawa888/Elxlog","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/sasagawa888%2FElxlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sasagawa888%2FElxlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sasagawa888%2FElxlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sasagawa888%2FElxlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sasagawa888","download_url":"https://codeload.github.com/sasagawa888/Elxlog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801599,"owners_count":20350106,"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":["elixir","prolog"],"created_at":"2025-03-15T22:37:31.709Z","updated_at":"2025-03-15T22:37:32.162Z","avatar_url":"https://github.com/sasagawa888.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elxlog\r\n\r\nSmall pure Prolog intepreter/compiler in Elixir.\r\nProject is called Elxlog.\r\nGoal is fusion of Elixir and Prolog\r\n\r\n## install\r\nmake clone or down load zip file\r\n\r\n## invoke\r\n\r\n  mix elxlog\r\n\r\n## quit\r\n\r\n halt().\r\n\r\n\r\n## caution\r\n - predicate with zero arity is written like this.\r\ne.g. halt()  true()  fail()\r\n\r\n - Returns false for non-existent predicates.\r\n \r\n - There is no op/3.\r\n\r\n - float number is same as ISO-Prolog e.g. 3.0e4\r\n\r\n - comma and period is delimiter. Not operator.\r\n\r\n - The comparison operation is the same as C and Elixir.\r\n e.g. \u003c \u003e \u003e= \u003c= == !=\r\n\r\n - Anonymous variables in the same clause are not distinguished.\r\n\r\n - Elixir code can be mixed in the file read by reconsult/1.\r\n The line after \"!Elixir\" is Elixir code. see test.pl\r\n\r\n - There is no higher-order predicate such as call/1 assert/1 once/1.\r\n Within first order predicate logic.\r\n\r\n - Predicates with the same predicate name but different Arity are not allowed.\r\n\r\n## builtin\r\n```\r\n  append/3\r\n  arg/3\r\n  atom/1\r\n  atomic/1\r\n  between/3\r\n  elixir/1  Run the Elixir code. See test.pl (e.g. elixir(elx_in_the_park()) )\r\n  float/1\r\n  fail/0\r\n  functor/3\r\n  halt/0\r\n  integer/1\r\n  is/2\r\n  length/2\r\n  listing/1\r\n  member/2\r\n  name/2\r\n  nl/0\r\n  nonvar/1\r\n  not/1\r\n  number/1\r\n  read/1\r\n  reconsult/1  (or ['filename.pl'])\r\n  time/1\r\n  true/0\r\n  var/1\r\n  write/1\r\n  =/2\r\n  \u003c/2\r\n  \u003e/2\r\n  \u003e=/2\r\n  \u003c=/2\r\n  !=/2\r\n  ==/2\r\n  =../2\r\n\r\nformula:\r\n  +,^,*,/,^\r\n  prefix \"elx_\" means Elixir function. See test.pl\r\n```\r\n\r\n## Example\r\n```\r\nmix elxlog\r\nCompiling 1 file (.ex)\r\nElxlog ver0.XX\r\n?- ['test.pl'].\r\ntrue\r\n?- listing().\r\nfact(0,1)\r\nfact(N,A) :- is(N1,N-1),fact(N1,A1),is(A,N*A1).\r\nlikes(kim,robin)\r\nlikes(sandy,lee)\r\nlikes(sandy,kim)\r\nlikes(robin,cats)\r\nlikes(sandy,X) :- likes(X,cats).\r\nlikes(kim,X) :- likes(X,lee),likes(X,kim).\r\nlikes(X,X)\r\ntrue\r\n?- X is elx_ack(3,11).\r\nX = 16381\r\ntrue\r\n?- fact(10,X).\r\nX = 3628800\r\ntrue\r\n?- likes(sandy,Who).\r\nWho = lee;\r\nWho = kim;\r\nWho = robin;\r\nWho = sandy;\r\nWho = cats;\r\nWho = sandy;\r\nfalse\r\n?- append(X,Y,[1,2,3]).\r\nX = []\r\nY = [1,2,3];\r\nX = [1]\r\nY = [2,3];\r\nX = [1,2]\r\nY = [3];\r\nX = [1,2,3]\r\nY = [];\r\nfalse\r\n?- halt().\r\ngoodbye\r\n```\r\n# compiler\r\n\r\n```\r\nElxlog ver0.12\r\n?- compile('test.pl').\r\ntrue\r\n?- ['test.o'].\r\ntrue\r\n?- my_member(2,[1,2,3]).\r\ntrue\r\n?- fact(10,X).\r\nX = 3628800.\r\ntrue\r\n?-\r\n```\r\n\r\n# parallel\r\nbuiltin parallel/n\r\n\r\nsee test.pl pqsort/2 and pfib/2\r\n\r\n```\r\nElxlog ver0.14\r\n?- ['test.pl'].\r\ntrue\r\n?- time(fib(15,X)).\r\n\"time: 2790153 micro second\"\r\nX = 610\r\ntrue\r\n?- time(pfib(15,X)).\r\n\"time: 1082117 micro second\"\r\nX = 610\r\ntrue\r\n?-\r\n\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsasagawa888%2Felxlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsasagawa888%2Felxlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsasagawa888%2Felxlog/lists"}