{"id":15451510,"url":"https://github.com/davidar/moded-logic","last_synced_at":"2025-04-04T14:14:43.900Z","repository":{"id":49300151,"uuid":"351651743","full_name":"davidar/moded-logic","owner":"davidar","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-19T07:10:23.000Z","size":1455,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T23:47:59.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidar.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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":"2021-03-26T03:36:25.000Z","updated_at":"2021-06-19T07:10:14.000Z","dependencies_parsed_at":"2022-09-05T03:01:36.964Z","dependency_job_id":null,"html_url":"https://github.com/davidar/moded-logic","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/davidar%2Fmoded-logic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidar%2Fmoded-logic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidar%2Fmoded-logic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidar%2Fmoded-logic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidar","download_url":"https://codeload.github.com/davidar/moded-logic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190253,"owners_count":20898702,"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-01T21:27:34.451Z","updated_at":"2025-04-04T14:14:43.878Z","avatar_url":"https://github.com/davidar.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# moded-logic\n\n[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/davidar/moded-logic)\n[![Coverage Status](https://coveralls.io/repos/github/davidar/moded-logic/badge.svg?branch=master)](https://coveralls.io/github/davidar/moded-logic?branch=master)\n\nA Haskell implementation of [Constraint-Based Mode Analysis of Mercury](https://lara.epfl.ch/w/_media/cc09:modeanalysisoverton.pdf), targeting [the Logic monad](https://hackage.haskell.org/package/logict).\n\n## Logic program\n\n```hs\nappend [] b b.\nappend (h:t) b (h:tb) :- append t b tb.\n```\n\n## Usage\n\n```hs\n\u003e observeAll (append_ooi [1..5])\n[([],[1,2,3,4,5]),([1],[2,3,4,5]),([1,2],[3,4,5]),([1,2,3],[4,5]),([1,2,3,4],[5]),([1,2,3,4,5],[])]\n```\n\n## Code generated by mode analysis\n\n```hs\nappend_iii a1 a2 a3 = (do\n  guard $ a1 == []\n  b \u003c- pure a2\n  guard $ a3 == b\n  pure ()\n ) \u003c|\u003e (do\n  (h0:t) \u003c- pure a1\n  b \u003c- pure a2\n  (h1:tb) \u003c- pure a3\n  h \u003c- pure h1\n  guard $ h0 == h\n  () \u003c- append_iii t b tb\n  pure ()\n )\n\nappend_iio a1 a2 = (do\n  guard $ a1 == []\n  b \u003c- pure a2\n  a3 \u003c- pure b\n  pure (a3)\n ) \u003c|\u003e (do\n  (h0:t) \u003c- pure a1\n  h \u003c- pure h0\n  h1 \u003c- pure h\n  b \u003c- pure a2\n  (tb) \u003c- append_iio t b\n  a3 \u003c- pure (h1:tb)\n  pure (a3)\n )\n\nappend_ooi a3 = (do\n  a1 \u003c- pure []\n  b \u003c- pure a3\n  a2 \u003c- pure b\n  pure (a1,a2)\n ) \u003c|\u003e (do\n  (h1:tb) \u003c- pure a3\n  h \u003c- pure h1\n  h0 \u003c- pure h\n  (t,b) \u003c- append_ooi tb\n  a1 \u003c- pure (h0:t)\n  a2 \u003c- pure b\n  pure (a1,a2)\n )\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidar%2Fmoded-logic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidar%2Fmoded-logic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidar%2Fmoded-logic/lists"}