{"id":51012494,"url":"https://github.com/ligurio/ljopt","last_synced_at":"2026-06-21T05:01:47.140Z","repository":{"id":363615853,"uuid":"562751533","full_name":"ligurio/ljopt","owner":"ligurio","description":"Translate LuaJIT IR to SMT-LIB","archived":false,"fork":false,"pushed_at":"2026-06-18T21:16:21.000Z","size":603,"stargazers_count":0,"open_issues_count":26,"forks_count":0,"subscribers_count":1,"default_branch":"devel","last_synced_at":"2026-06-18T22:23:47.510Z","etag":null,"topics":["ir","lua","luajit","smt","z3"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/ligurio.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,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-07T07:20:27.000Z","updated_at":"2026-06-16T13:41:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ligurio/ljopt","commit_stats":null,"previous_names":["ligurio/ljopt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ligurio/ljopt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ligurio%2Fljopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ligurio%2Fljopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ligurio%2Fljopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ligurio%2Fljopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ligurio","download_url":"https://codeload.github.com/ligurio/ljopt/tar.gz/refs/heads/devel","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ligurio%2Fljopt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34594326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ir","lua","luajit","smt","z3"],"created_at":"2026-06-21T05:01:43.874Z","updated_at":"2026-06-21T05:01:47.125Z","avatar_url":"https://github.com/ligurio.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Translate LuaJIT IR to SMT-LIB\n\nis an implementation of translation validation for LuaJIT.\n\n### Building\n\n```sh\nmake build\n```\n\n### Requirements\n- LuaJIT v2.1 with Lua functions `jit.util.snappc()` and `jit.util.tablesize()`.\n- Z3 \u003e= `4.15.3` is recommended, equivalence of some traces could not be\nproved on earlier versions.\n\n### Usage\n\nCreate a file with Lua source code:\n\n```sh\n$ cat \u003c\u003c EOF \u003e example.lua\nfor i = 1, 100 do local a, b = 23, 11; y = a + b end\nEOF\n```\n\nExecute LuaJIT with disabled and enabled optimisation `fold`:\n\n```diff\n$ diff -u \u003c(luajit -O-fold -jdump=Ti example.lua) \u003c(luajit -O+fold -jdump=Ti example.lua)\n\n--- /dev/fd/63\t2023-11-02 19:40:58.479664213 +0300\n+++ /dev/fd/62\t2023-11-02 19:40:58.479664213 +0300\n@@ -1,32 +1,21 @@\n ---- TRACE 1 start example.lua:1\n ---- TRACE 1 IR\n 0001    int SLOAD  #1    CI\n-0002 \u003e  int ADDOV  +23   +11\n-0003    fun SLOAD  #0    R\n-0004    tab FLOAD  0003  func.env\n-0005    int FLOAD  0004  tab.hmask\n-0006 \u003e  int EQ     0005  +63\n-0007    p32 FLOAD  0004  tab.node\n-0008 \u003e  p32 HREFK  0007  \"y\"  @35\n-0009    tab FLOAD  0004  tab.meta\n-0010 \u003e  tab EQ     0009  NULL\n-0011    num CONV   0002  num.int\n-0012    num HSTORE 0008  0011\n-0013    nil TBAR   0004\n-0014  + int ADD    0001  +1\n-0015 \u003e  int LE     0014  +100\n-0016 ------ LOOP ------------\n-0017    tab FLOAD  0003  func.env\n-0018    int FLOAD  0017  tab.hmask\n-0019 \u003e  int EQ     0018  +63\n-0020    p32 FLOAD  0017  tab.node\n-0021 \u003e  p32 HREFK  0020  \"y\"  @35\n-0022    tab FLOAD  0017  tab.meta\n-0023 \u003e  tab EQ     0022  NULL\n-0024    num HSTORE 0021  0011\n-0025    nil TBAR   0017\n-0026  + int ADD    0014  +1\n-0027 \u003e  int LE     0026  +100\n-0028    int PHI    0014  0026\n+0002    fun SLOAD  #0    R\n+0003    tab FLOAD  0002  func.env\n+0004    int FLOAD  0003  tab.hmask\n+0005 \u003e  int EQ     0004  +63\n+0006    p32 FLOAD  0003  tab.node\n+0007 \u003e  p32 HREFK  0006  \"y\"  @35\n+0008    tab FLOAD  0003  tab.meta\n+0009 \u003e  tab EQ     0008  NULL\n+0010    num HSTORE 0007  +34\n+0011    nil TBAR   0003\n+0012  + int ADD    0001  +1\n+0013 \u003e  int LE     0012  +100\n+0014 ------ LOOP ------------\n+0015  + int ADD    0012  +1\n+0016 \u003e  int LE     0015  +100\n+0017    int PHI    0012  0015\n ---- TRACE 1 stop -\u003e loop\n```\n\nTranslate IR to SMT-LIB:\n\n```sh\n$ LUA_PATH=\"./?/init.lua;;\" bin/ljopt example.lua \u003e example.smt2\n```\n\nValidate correctness of the `fold` optimisation with SMT solver, for example\nZ3:\n\n```sh\n$ z3 -smt2 example.smt2\n```\n\n### License\n\nThe MIT License, see LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fligurio%2Fljopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fligurio%2Fljopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fligurio%2Fljopt/lists"}