{"id":15653088,"url":"https://github.com/ilya-klyuchnikov/mrsc","last_synced_at":"2025-08-23T19:11:31.252Z","repository":{"id":138035970,"uuid":"1654277","full_name":"ilya-klyuchnikov/mrsc","owner":"ilya-klyuchnikov","description":"A toolkit for building multi-result supercompilers","archived":false,"fork":false,"pushed_at":"2021-10-23T10:18:04.000Z","size":2131,"stargazers_count":30,"open_issues_count":41,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-30T21:09:52.530Z","etag":null,"topics":["partial-evaluation","supercompilation"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/ilya-klyuchnikov.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-04-23T17:57:21.000Z","updated_at":"2024-11-05T00:36:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"386b0bd5-1f6b-4d8a-8881-43eb950e31c9","html_url":"https://github.com/ilya-klyuchnikov/mrsc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilya-klyuchnikov%2Fmrsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilya-klyuchnikov%2Fmrsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilya-klyuchnikov%2Fmrsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilya-klyuchnikov%2Fmrsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilya-klyuchnikov","download_url":"https://codeload.github.com/ilya-klyuchnikov/mrsc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251782776,"owners_count":21642987,"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":["partial-evaluation","supercompilation"],"created_at":"2024-10-03T12:44:39.918Z","updated_at":"2025-04-30T21:09:54.319Z","avatar_url":"https://github.com/ilya-klyuchnikov.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MRSC\n\nMRSC is a toolkit for rapid design and prototyping of (multi-result) supercompilers. \nMRSC 1.0 provides generic data structures and operations for building supercompilers \nbased on the concept of *graph of configurations*. A supercompiler is encoded as a set \nof graph rewrite rules.\n\n## Papers\n\nThe theory behind MRSC is described in the following papers:\n\n* Ilya Klyuchnikov and Sergei Romanenko. \nMulti-Result Supercompilation as Branching Growth of the Penultimate Level in Metasystem Transitions.\n_Ershov Informatics Conference 2011_. \n\u003ca href=\"http://pat.keldysh.ru/~ilya/papers/2011-branching-growth.pdf\"\u003epdf\u003c/a\u003e (Revised version is in\nLNCS 7162, pp. 210–226, 2012)\n* Ilya Klyuchnikov and Sergei Romanenko. \nMRSC: a toolkit for building multi-result supercompilers. \n_Preprint 77. Keldysh Institute of Applied Mathematics, Moscow_. 2011. \n\u003ca href=\"http://www.keldysh.ru/papers/2011/source/prep2011_77_eng.pdf\"\u003epdf\u003c/a\u003e\n\n## Code structure\n\nMRSC is divided in a number of packages:\n\n* `mrsc.core`\n  * Generic data structures (`SGraph` and `TGraph`) for representing a graph of configurations and operations\n    on them.\n  * An abstraction `GraphRewriteRules` for encoding the logic of supercompilation in terms of rewriting rules.\n  * The component `GraphGenerator` for incremental producing _all_ possible graphs of configurations\n    for a given set of rewriting rules.\n* `mrsc.counters`\n  * Example of a very simple (but non-trivial!) supercompiler for counter systems (see below). \n\n## Example: generating proofs of safety of cache-coherence protocols\n\nThe entry point to this example is `mrsc/counters/demo.scala` (just launch it to see results in the console).\n\nThe package `mrsc.counters` contains an example of building a traditional (single-result) supercompiler and a (novel)\nmulti-result supercompiler for counter systems. This example is inspired by works by Andrei Nemytykh, Alexei Lisitsa \nand Andrei Klimov:\n\n1. A. Lisitsa and A. Nemytykh. Verification as a parameterized testing (experiments with the SCP4 supercompiler).\n   Programming and Computer Software. vol. 33. 2007\n2. Andrei V. Klimov, A Java Supercompiler and its Application to Verification of Cache-Coherence Protocols. \n   In: Perspectives of Systems Informatics: 7th International Andrei Ershov Memorial Conference, PSI 2009, \n   Novosibirsk, Russia, June 15-19, 2009. Revised Papers. Lecture Notes in Computer Science, volume 5947/2010, \n   pages 185-192. Springer Berlin / Heidelberg, 2010.\n3. Andrei V. Klimov, Solving Coverability Problem for Monotonic Counter Systems by Supercompilation. \n   In: E.M. Clarke, I. Virbitskaite, A. Voronkov (eds.), Proceedings of the Ershov Informatics Conference (PSI 2011), \n   June 17 – July 01, 2011, Akademgorodok, Novosibirsk, Russia. Novosibirsk: Ershov Institute of Informatics Systems, 2011. P. 92-103.\n4. \u003ca href=\"http://refal.botik.ru/protocols/\"\u003eSCP 4 : Verification of Protocols\u003c/a\u003e\n5. \u003ca href=\"http://pat.keldysh.ru/jver/\"\u003eThe project JVer\u003c/a\u003e\n\nThe works [1, 2, 4, 5] use the following approach for verification of protocols: express a protocol and its safety \nproperty as a Java of Refal program, supercompile a boolean expression stating the safety property of protocol - \nfrom the structure of supercompiled expression it will follow the safety of protocol. Following [3], we \ncreated a tiny language (of configurations) for encoding states of protocols (`mrsc/counters/language.scala`).\nThen protocols are expressed in Scala directly - as a DSL over the language of configurations \n(`mrsc/counters/protocols.scala`). There are two supercompilers in `mrsc/counters/rules.scala` encoded as graph \nrewrite rules - traditional single-result one and multi-result one. These supercompilers build graphs of \nconfigurations for a given protocol. Using a graph of configurations, we are able to produce a proof \nof safety of a protocol for a proof assistant \u003ca href=\"http://isabelle.in.tum.de/\"\u003eIsabelle\u003c/a\u003e \n(`mrsc/counters/proof.scala`). Demo application in `mrsc/counters/demo.scala` puts all things together: \nfor a number of protocols traditional supercompiler is launched (as in [3]), multi-result supercompiler is launched and \nthe smallest graphs is then selected from a set of graphs generated by multi-result supercompiler. \nThe smallest graph is then residuated into a proof for Isabelle. More details are in an upcoming paper.\nThe output of demo is shown in [proofs.md](https://github.com/ilya-klyuchnikov/mrsc/blob/master/proofs.md).\n\n## Tests and examples\n\nBy default, tests and samples output is note verbose (to prevent a garbage in output). However, if you really want\nto see all details:\n```\n\u003e project MRSCPfp\n\u003e set javaOptions += \"-Dmrsc.verbose=true\"\n\u003e testOnly mrsc.pfp.test.TicksEvaluationSuite\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filya-klyuchnikov%2Fmrsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filya-klyuchnikov%2Fmrsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filya-klyuchnikov%2Fmrsc/lists"}