{"id":19522260,"url":"https://github.com/programarivm/truth-table","last_synced_at":"2025-02-26T00:47:22.162Z","repository":{"id":62530862,"uuid":"299031384","full_name":"programarivm/truth-table","owner":"programarivm","description":"Data structure representing a logical truth table.","archived":false,"fork":false,"pushed_at":"2020-09-29T16:50:15.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T14:16:11.157Z","etag":null,"topics":["binary","boolean","false","logic","table","ternary","three","true","truth"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/programarivm.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}},"created_at":"2020-09-27T12:51:51.000Z","updated_at":"2020-09-29T16:56:34.000Z","dependencies_parsed_at":"2022-11-02T15:31:55.398Z","dependency_job_id":null,"html_url":"https://github.com/programarivm/truth-table","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/programarivm%2Ftruth-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/programarivm%2Ftruth-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/programarivm%2Ftruth-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/programarivm%2Ftruth-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/programarivm","download_url":"https://codeload.github.com/programarivm/truth-table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240771905,"owners_count":19854982,"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":["binary","boolean","false","logic","table","ternary","three","true","truth"],"created_at":"2024-11-11T00:37:58.995Z","updated_at":"2025-02-26T00:47:21.745Z","avatar_url":"https://github.com/programarivm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Truth Table\n\n[![Build Status](https://travis-ci.org/programarivm/truth-table.svg?branch=master)](https://travis-ci.org/programarivm/truth-table)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://github.com/programarivm/truth-table/blob/master/resources/logo.png\" /\u003e\n\u003c/p\u003e\n\n\u003e A truth table is a mathematical table used in logic which sets out the functional values of logical expressions on each of their functional arguments. [Wikipedia](https://en.wikipedia.org/wiki/Truth_table).\n\n### Install\n\nVia composer:\n\n    $ composer require programarivm/truth-table\n\n### Binary Table\n\nCreate a binary table with two input variables:\n\n```php\nuse TruthTable\\BinaryTable;\n\n$t = (new BinaryTable(2))-\u003egetTable();\n\n```\n\nGet the result of the table:\n\n```php\nuse TruthTable\\BinaryTable;\n\n$r = (new BinaryTable(2))-\u003egetResult();\n\n```\n\nSet specific indexes to `true` and get the result:\n\n```php\nuse TruthTable\\BinaryTable;\n\n$true = [0, 1];\n\n$r = (new BinaryTable(2))\n\t\t-\u003esetTrue($true)\n\t\t-\u003egetResult();\n\n```\n\nSet specific indexes to `false` and get the result:\n\n```php\nuse TruthTable\\BinaryTable;\n\n$false = [0, 1];\n\n$r = (new BinaryTable(2))\n\t\t-\u003esetFalse($false)\n\t\t-\u003egetResult();\n\n```\n\n### Ternary Table\n\nCreate a ternary table with two input variables:\n\n```php\nuse TruthTable\\TernaryTable;\n\n$t = (new TernaryTable(2))-\u003egetTable();\n\n```\n\nGet the result of the table:\n\n```php\nuse TruthTable\\TernaryTable;\n\n$r = (new TernaryTable(2))-\u003egetResult();\n\n```\n\nSet specific indexes to `true` and get the result:\n\n```php\nuse TruthTable\\TernaryTable;\n\n$true = [0, 1];\n\n$r = (new TernaryTable(2))\n\t\t-\u003esetTrue($true)\n\t\t-\u003egetResult();\n\n```\n\nSet specific indexes to `false` and get the result:\n\n```php\nuse TruthTable\\TernaryTable;\n\n$false = [0, 1];\n\n$r = (new TernaryTable(2))\n\t\t-\u003esetFalse($false)\n\t\t-\u003egetResult();\n\n```\n\nSet specific indexes to unknown and get the result:\n\n```php\nuse TruthTable\\TernaryTable;\n\n$unknown = [0, 1];\n\n$r = (new TernaryTable(2))\n\t\t-\u003esetUnknown($unknown)\n\t\t-\u003egetResult();\n\n```\n\nFor further details please look at the [unit tests](https://github.com/programarivm/truth-table/tree/master/tests).\n\n### License\n\nThe GNU General Public License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramarivm%2Ftruth-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogramarivm%2Ftruth-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramarivm%2Ftruth-table/lists"}