{"id":26883681,"url":"https://github.com/jiro4989/colc","last_synced_at":"2025-03-31T17:36:41.842Z","repository":{"id":57621806,"uuid":"154977891","full_name":"jiro4989/colc","owner":"jiro4989","description":"CombinatorLogic文字列を計算するツール","archived":false,"fork":false,"pushed_at":"2019-03-06T03:15:15.000Z","size":574,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T15:46:00.168Z","etag":null,"topics":["cli","combinator","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/jiro4989.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":"2018-10-27T15:13:03.000Z","updated_at":"2024-06-20T15:46:00.169Z","dependencies_parsed_at":"2022-08-26T23:42:10.779Z","dependency_job_id":null,"html_url":"https://github.com/jiro4989/colc","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fcolc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fcolc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fcolc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fcolc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiro4989","download_url":"https://codeload.github.com/jiro4989/colc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246509922,"owners_count":20789261,"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":["cli","combinator","golang"],"created_at":"2025-03-31T17:36:40.233Z","updated_at":"2025-03-31T17:36:41.823Z","avatar_url":"https://github.com/jiro4989.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# colc (COmbinator Logic Calculator)\n[![Build Status](https://travis-ci.org/jiro4989/colc.svg?branch=master)](https://travis-ci.org/jiro4989/colc)\n\nCombinator Logicをコマンドラインから使うためのツール\n\n## コンビネータ論理(Combinator Logic)とは\n引数に関数を受け取る関数(コンビネータ)のみで計算をするという考え方をコンビネータ\n論理という。\nチューリング完全であることが証明されているため、コンピュータで可能な計算は全てコ\nンビネータだけで計算が可能である。\n\n以下にコンビネータ論理の主要な関数3つの例を示す。\n\n### Sコンビネータ\nSコンビネータは3つのコンビネータを引数に取り、以下のように並び替える。  \n※xyzはそれぞれ x y zという3つのコンビネータである。\n\n```\nSxyz -\u003e xz(yz)\n```\n\n以下の図のように、上記コンビネータはそれぞれ4つのコンビネータに分割され、3つの引\n数を計算に利用する。\n\n![Sコンビネータとコンビネータの分割](doc/graphviz/s_combinator.png)\n\n### Kコンビネータ\nKコンビネータは2つのコンビネータを引数に取り、1つ目のコンビネータを返す。\n\n```\nKxy -\u003e x\n```\n\n### Iコンビネータ\nIコンビネータは1つのコンビネータを引数に取り、1つ目のコンビネータを返す。\n\n```\nIx -\u003e x\n```\n\n### コンビネータの処理の流れ\nコンビネータは計算不能になるまで計算結果を次の計算に利用する。\n前述のSKIコンビネータによる連続した計算の例を以下に示す。\n\n![SKIの計算の流れ](doc/graphviz/mix_combinator.png)\n\n上記の計算の例では、最終的に x というコンビネータに到達した。\nxというコンビネータは存在しないため、計算できずに計算を終了している。\nよって、 SKIx というコンビネータの計算結果は x である\n\n## colcコマンド\ncolcコマンドは上記のような一連の計算をコマンドライン(以下CLI)上で行えるようにし\nたものである。\n\n### インストール方法\n[Go言語](https://golang.org/doc/install)をインストールし、以下のコマンドを実行する。\n\n```bash\ngo get github.com/jiro4989/colc\n```\n\nまたは、このGitHubのReleaseページのバイナリをダウンロードする。\n\n### ヘルプ\n\n`colc -h`で確認できる。\n\n    Usage:\n      colc [OPTIONS]\n\n    Application Options:\n      -v, --version         バージョン情報\n      -s, --stepcount=      何ステップまで計算するか (default: -1)\n      -o, --outfile=        出力ファイルパス\n      -t, --outfiletype=    出力ファイルの種類(なし|json)\n      -i, --indent=         outfiletypeが有効時に整形して出力する\n      -c, --combinatorFile= コンビネータ定義ファイルパス\n      -p, --print           計算過程を出力する\n      -n, --noprintheader   printフラグON時のヘッダ出力を消す\n\n    Help Options:\n      -h, --help            Show this help message\n\n### 使い方\n\n```bash\necho \"Sxyz\" | colc\n# -\u003e xz(yz)\n\ncolc clcode.txt\n\ncolc clcode.txt clcode2.txt\n\n# ファイル出力\ncolc clcode.txt -o out.txt\n\n# コンビネータ定義ファイルを読み込む\ncolc -c config/combinator.json clcode.txt\n```\n\n\u003c!--\n```bash\n\n# JSON出力\ncolc clcode.txt -t json\ncolc clcode.txt -t json -o out.json\n```\n--\u003e\n\n### 仕様\n\n1. 計算対象のテキストデータは行単位である。\n1. 引数(処理対象のテキストファイル)が未指定の場合、標準入力待ちとなる。\n1. 処理対象のテキストファイルは複数受け取れる。\n1. 最後まで計算させたくない場合は、計算ステップ数を指定して実行できる。\n\n## 開発\n### ヘルプ\n\n```bash\nmake\n```\n\n### バイナリの生成\n\n```bash\nmake build\n```\n\n### グラフ画像の生成\n\n```bash\nmake graph\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Fcolc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiro4989%2Fcolc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Fcolc/lists"}