{"id":21842188,"url":"https://github.com/fpg1503/generic-zebra-solver","last_synced_at":"2026-01-28T12:34:06.061Z","repository":{"id":75503900,"uuid":"44485225","full_name":"fpg1503/Generic-Zebra-Solver","owner":"fpg1503","description":"🎹 A Prolog solver using CLPFD to any logic puzzle like the Zebra Puzzle","archived":false,"fork":false,"pushed_at":"2015-12-24T18:43:28.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T19:07:08.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/fpg1503.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}},"created_at":"2015-10-18T16:06:54.000Z","updated_at":"2018-12-28T05:59:08.000Z","dependencies_parsed_at":"2023-03-16T06:15:41.731Z","dependency_job_id":null,"html_url":"https://github.com/fpg1503/Generic-Zebra-Solver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fpg1503/Generic-Zebra-Solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpg1503%2FGeneric-Zebra-Solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpg1503%2FGeneric-Zebra-Solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpg1503%2FGeneric-Zebra-Solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpg1503%2FGeneric-Zebra-Solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fpg1503","download_url":"https://codeload.github.com/fpg1503/Generic-Zebra-Solver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpg1503%2FGeneric-Zebra-Solver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-27T22:10:59.771Z","updated_at":"2026-01-28T12:34:06.046Z","avatar_url":"https://github.com/fpg1503.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generic Zebra Solver\nA Prolog solver using CLPFD to any logic puzzle like the Zebra Puzzle\n\n[![Build Status](https://travis-ci.org/fpg1503/Generic-Zebra-Solver.svg)](https://travis-ci.org/fpg1503/Generic-Zebra-Solver)\n\n# Specification\n\n## Solver Predicate\nThe predicate `solver(+Filename, -Solution)` is satisfied when `Solution` is the solution of the logic puzzle specified by the file named `Filename`.\n\n## Puzzle definition\n\nA puzzle is defined by a `.prob` file which consists in a **list of domains** and a **list of constraints**. There must be a blank line between the list of domains and the list of constraints.\n\n### List of Domains\nThe domain list consists of the domain name followed by a colon and the list of possible values separated by commas. Each domains must be in a single line. All domains **must** have the same nember of possible values.\n\nThe domain `color` with the colors `blue`, `red`, and `black` can be represented as follows:\n\n```\ncolor: blue, red, black\n```\n\nanalogously `nacionality` can be defined as:\n\n```\nnacionality: german, spanish, italian\n```\n\n\n### List of Constraints\n\nA list of contraints consists of several constraints, one per line followed by an empty line.\n\nEach constraint is represented by a logical expression which, by definition, is true. This expression is one of\n- `LHS = RHS`\n- `LHS \u003c RHS`\n- `LHS \u003e RHS`\n\nwhere `LHS` and `RHS` are mathematical expressions.\n\nA constraint can also be\n- `LHS or RHS`\nwhere `LHS` and `RHS` are one of the logical expressions defined above.\n\nFor simplicity sake let's define a `value` as either an `integer` or a  `variable`. With that in mind a mathematical expression is one of\n\n- `value`\n- `value + value`\n- `value - value`\n- `abs(mathematical_expression)`\n\nSome sample constraints are:\n\n```\nspanish = red + 1\ngerman = blue\nitalian = 2\ngerman = 3 or black - 2 = abs(red - blue)\n```\n\n## Solution definition\n\n`Solution` is a Prolog list of `variable assignment`s. The first house is assumed to be number one.\n\n### Variable Assignment\nA `variable assignment` consists of the functor `c` with arity 2 where the first argument is the variable name and the second is the its value, for example\n\n```\n[c(italian,2),c(spanish,3),c(german,1),c(black,3),c(red,2),c(blue,1)]\n```\n\n# Contributing\n\nPlease fell free to fork, and create issues for any bugs/improvements/doubts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpg1503%2Fgeneric-zebra-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffpg1503%2Fgeneric-zebra-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpg1503%2Fgeneric-zebra-solver/lists"}