Luke Geeson, James Brotherston, Wilco Dijkstra, Alastair F. Donaldson, Lee Smith, Tyler Sorensen, John Wickerson
The correctness of complex software depends on the correctness of both the source code and the compilers that generate corresponding binary code. Compilers must do more than preserve the semantics of a single source file: they must ensure that generated binaries can be composed with other binaries to form a final executable. The compatibility of composition is ensured using an Application Binary Interface (ABI), which specifies details of calling conventions, exception handling, and so on. Unfortunately, there are no official ABIs for concurrent programs, so different atomics mappings, although correct in isolation, may induce bugs when composed. Indeed, today, mixing binaries generated by different compilers can lead to an erroneous resulting binary. We present mix testing: a new technique designed to find compiler bugs when the instructions of a C/C++ test are separately compiled for multiple compatible architectures and then mixed together. We define a class of compiler bugs, coined mixing bugs, that arise when parts of a program are compiled separately using different mappings from C/C++ atomic operations to assembly sequences. To demonstrate the generality of mix testing, we have designed and implemented a tool, atomic-mixer, which we have used: (a) to reproduce one existing non-mixing bug that state-of-the-art concurrency testing tools are limited to being able to find (showing that atomic-mixer at least meets the capabilities of these tools), and (b) to find four previously-unknown mixing bugs in LLVM and GCC, and one prospective mixing bug in mappings proposed for the Java Virtual Machine. Lastly, we have worked with engineers at Arm to specify, for the first time, an atomics ABI for Armv8, and have used atomic-mixer to validate the LLVM and GCC compilers against it.
{"title":"Mix Testing: Specifying and Testing ABI Compatibility of C/C++ Atomics Implementations","authors":"Luke Geeson, James Brotherston, Wilco Dijkstra, Alastair F. Donaldson, Lee Smith, Tyler Sorensen, John Wickerson","doi":"arxiv-2409.01161","DOIUrl":"https://doi.org/arxiv-2409.01161","url":null,"abstract":"The correctness of complex software depends on the correctness of both the\u0000source code and the compilers that generate corresponding binary code.\u0000Compilers must do more than preserve the semantics of a single source file:\u0000they must ensure that generated binaries can be composed with other binaries to\u0000form a final executable. The compatibility of composition is ensured using an\u0000Application Binary Interface (ABI), which specifies details of calling\u0000conventions, exception handling, and so on. Unfortunately, there are no\u0000official ABIs for concurrent programs, so different atomics mappings, although\u0000correct in isolation, may induce bugs when composed. Indeed, today, mixing\u0000binaries generated by different compilers can lead to an erroneous resulting\u0000binary. We present mix testing: a new technique designed to find compiler bugs when\u0000the instructions of a C/C++ test are separately compiled for multiple\u0000compatible architectures and then mixed together. We define a class of compiler\u0000bugs, coined mixing bugs, that arise when parts of a program are compiled\u0000separately using different mappings from C/C++ atomic operations to assembly\u0000sequences. To demonstrate the generality of mix testing, we have designed and\u0000implemented a tool, atomic-mixer, which we have used: (a) to reproduce one\u0000existing non-mixing bug that state-of-the-art concurrency testing tools are\u0000limited to being able to find (showing that atomic-mixer at least meets the\u0000capabilities of these tools), and (b) to find four previously-unknown mixing\u0000bugs in LLVM and GCC, and one prospective mixing bug in mappings proposed for\u0000the Java Virtual Machine. Lastly, we have worked with engineers at Arm to\u0000specify, for the first time, an atomics ABI for Armv8, and have used\u0000atomic-mixer to validate the LLVM and GCC compilers against it.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"109 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-09-02","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179543","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
The miniKanren and Relational Programming Workshop is a workshop for the miniKanren family of relational (pure constraint logic programming) languages: miniKanren, microKanren, core.logic, OCanren, Guanxi, etc. The workshop solicits papers and talks on the design, implementation, and application of miniKanren-like languages. A major goal of the workshop is to bring together researchers, implementors, and users from the miniKanren community, and to share expertise and techniques for relational programming. Another goal for the workshop is to push the state of the art of relational programming - for example, by developing new techniques for writing interpreters, type inferencers, theorem provers, abstract interpreters, CAD tools, and other interesting programs as relations, which are capable of being "run backward," performing synthesis, etc.
{"title":"Proceedings of the 2024 miniKanren and Relational Programming Workshop","authors":"Ekaterina Verbitskaia, Joseph P. Near","doi":"arxiv-2409.06505","DOIUrl":"https://doi.org/arxiv-2409.06505","url":null,"abstract":"The miniKanren and Relational Programming Workshop is a workshop for the\u0000miniKanren family of relational (pure constraint logic programming) languages:\u0000miniKanren, microKanren, core.logic, OCanren, Guanxi, etc. The workshop\u0000solicits papers and talks on the design, implementation, and application of\u0000miniKanren-like languages. A major goal of the workshop is to bring together\u0000researchers, implementors, and users from the miniKanren community, and to\u0000share expertise and techniques for relational programming. Another goal for the\u0000workshop is to push the state of the art of relational programming - for\u0000example, by developing new techniques for writing interpreters, type\u0000inferencers, theorem provers, abstract interpreters, CAD tools, and other\u0000interesting programs as relations, which are capable of being \"run backward,\"\u0000performing synthesis, etc.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"6 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-09-02","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179549","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Doehyun Baek, Jakob Getz, Yusung Sim, Daniel Lehmann, Ben L. Titzer, Sukyoung Ryu, Michael Pradel
WebAssembly (Wasm for short) brings a new, powerful capability to the web as well as Edge, IoT, and embedded systems. Wasm is a portable, compact binary code format with high performance and robust sandboxing properties. As Wasm applications grow in size and importance, the complex performance characteristics of diverse Wasm engines demand robust, representative benchmarks for proper tuning. Stopgap benchmark suites, such as PolyBenchC and libsodium, continue to be used in the literature, though they are known to be unrepresentative. Porting of more complex suites remains difficult because Wasm lacks many system APIs and extracting real-world Wasm benchmarks from the web is difficult due to complex host interactions. To address this challenge, we introduce Wasm-R3, the first record and replay technique for Wasm. Wasm-R3 transparently injects instrumentation into Wasm modules to record an execution trace from inside the module, then reduces the execution trace via several optimizations, and finally produces a replay module that is executable sandalone without any host environment - on any engine. The benchmarks created by our approach are (i) realistic, because the approach records real-world web applications, (ii) faithful to the original execution, because the replay benchmark includes the unmodified original code, only adding emulation of host interactions, and (iii) standalone, because the replay benchmarks run on any engine. Applying Wasm-R3 to web-based Wasm applications in the wild demonstrates the correctness of our approach as well as the effectiveness of our optimizations, which reduce the recorded traces by 99.53 percent and the size of the replay benchmark by 9.98 percent. We release the resulting benchmark suite of 27 applications, called Wasm-R3-Bench, to the community, to inspire a new generation of realistic and standalone Wasm benchmarks.
{"title":"Wasm-R3: Record-Reduce-Replay for Realistic and Standalone WebAssembly Benchmarks","authors":"Doehyun Baek, Jakob Getz, Yusung Sim, Daniel Lehmann, Ben L. Titzer, Sukyoung Ryu, Michael Pradel","doi":"arxiv-2409.00708","DOIUrl":"https://doi.org/arxiv-2409.00708","url":null,"abstract":"WebAssembly (Wasm for short) brings a new, powerful capability to the web as\u0000well as Edge, IoT, and embedded systems. Wasm is a portable, compact binary\u0000code format with high performance and robust sandboxing properties. As Wasm\u0000applications grow in size and importance, the complex performance\u0000characteristics of diverse Wasm engines demand robust, representative\u0000benchmarks for proper tuning. Stopgap benchmark suites, such as PolyBenchC and\u0000libsodium, continue to be used in the literature, though they are known to be\u0000unrepresentative. Porting of more complex suites remains difficult because Wasm\u0000lacks many system APIs and extracting real-world Wasm benchmarks from the web\u0000is difficult due to complex host interactions. To address this challenge, we\u0000introduce Wasm-R3, the first record and replay technique for Wasm. Wasm-R3\u0000transparently injects instrumentation into Wasm modules to record an execution\u0000trace from inside the module, then reduces the execution trace via several\u0000optimizations, and finally produces a replay module that is executable\u0000sandalone without any host environment - on any engine. The benchmarks created\u0000by our approach are (i) realistic, because the approach records real-world web\u0000applications, (ii) faithful to the original execution, because the replay\u0000benchmark includes the unmodified original code, only adding emulation of host\u0000interactions, and (iii) standalone, because the replay benchmarks run on any\u0000engine. Applying Wasm-R3 to web-based Wasm applications in the wild\u0000demonstrates the correctness of our approach as well as the effectiveness of\u0000our optimizations, which reduce the recorded traces by 99.53 percent and the\u0000size of the replay benchmark by 9.98 percent. We release the resulting\u0000benchmark suite of 27 applications, called Wasm-R3-Bench, to the community, to\u0000inspire a new generation of realistic and standalone Wasm benchmarks.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"47 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179544","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Fault-tolerant quantum computation using lattice surgery can be abstracted as operations on graphs, wherein each logical qubit corresponds to a vertex of the graph, and multi-qubit measurements are accomplished by connecting the vertices with paths between them. Operations attempting to connect vertices without a valid path will result in abnormal termination. As the permissible paths may evolve during execution, it is necessary to statically verify that the execution of a quantum program can be completed. This paper introduces a type-based method to statically verify that well-typed programs can be executed without encountering halts induced by surgery operations. Alongside, we present $mathcal{Q}_{LS}$, a first-order quantum programming language to formalize the execution model of surgery operations. Furthermore, we provide a type checking algorithm by reducing the type checking problem to the offline dynamic connectivity problem.
{"title":"Type-Based Verification of Connectivity Constraints in Lattice Surgery","authors":"Ryo Wakizaka, Yasunari Suzuki, Atsushi Igarashi","doi":"arxiv-2409.00529","DOIUrl":"https://doi.org/arxiv-2409.00529","url":null,"abstract":"Fault-tolerant quantum computation using lattice surgery can be abstracted as\u0000operations on graphs, wherein each logical qubit corresponds to a vertex of the\u0000graph, and multi-qubit measurements are accomplished by connecting the vertices\u0000with paths between them. Operations attempting to connect vertices without a\u0000valid path will result in abnormal termination. As the permissible paths may\u0000evolve during execution, it is necessary to statically verify that the\u0000execution of a quantum program can be completed. This paper introduces a type-based method to statically verify that\u0000well-typed programs can be executed without encountering halts induced by\u0000surgery operations. Alongside, we present $mathcal{Q}_{LS}$, a first-order\u0000quantum programming language to formalize the execution model of surgery\u0000operations. Furthermore, we provide a type checking algorithm by reducing the\u0000type checking problem to the offline dynamic connectivity problem.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"82 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-08-31","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179546","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Paulo Emílio de Vilhena, Ori Lahav, Viktor Vafeiadis, Azalea Raad
Programs written in C/Ctexttt{++} often include textit{inline assembly}: a snippet of architecture-specific assembly code used to access low-level functionalities that are impossible or expensive to simulate in the source language. % Although inline assembly is widely used, its semantics has not yet been formally studied. In this paper, we overcome this deficiency by investigating the effect of inline assembly on the textit{consistency} semantics of~C/Ctexttt{++} programs. % We propose the first memory model of the~Ctexttt{++} Programming Language with support for inline assembly for Intel's textsf{x86} including textit{non-temporal stores} and textit{store fences}. % We argue that previous provably correct compiler optimizations and correct compiler mappings should remain correct under such an extended model and we prove that this requirement is met by our proposed model.
{"title":"Extending the C/Ctexttt{++} Model with Inline Assembly","authors":"Paulo Emílio de Vilhena, Ori Lahav, Viktor Vafeiadis, Azalea Raad","doi":"arxiv-2408.17208","DOIUrl":"https://doi.org/arxiv-2408.17208","url":null,"abstract":"Programs written in C/Ctexttt{++} often include textit{inline assembly}: a\u0000snippet of architecture-specific assembly code used to access low-level\u0000functionalities that are impossible or expensive to simulate in the source\u0000language. % Although inline assembly is widely used, its semantics has not yet\u0000been formally studied. In this paper, we overcome this deficiency by investigating the effect of\u0000inline assembly on the textit{consistency} semantics of~C/Ctexttt{++}\u0000programs. % We propose the first memory model of the~Ctexttt{++} Programming\u0000Language with support for inline assembly for Intel's textsf{x86} including\u0000textit{non-temporal stores} and textit{store fences}. % We argue that\u0000previous provably correct compiler optimizations and correct compiler mappings\u0000should remain correct under such an extended model and we prove that this\u0000requirement is met by our proposed model.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"5 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142223612","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
A $lambda$-calculus is introduced in which all programs can be evaluated in probabilistic polynomial time and in which there is sufficient structure to represent sequential cryptographic constructions and adversaries for them, even when the latter are oracle-based. A notion of observational equivalence capturing computational indistinguishability and a class of approximate logical relations are then presented, showing that the latter represent a sound proof technique for the former. The work concludes with the presentation of an example of a security proof in which the encryption scheme induced by a pseudorandom function is proven secure against active adversaries in a purely equational style.
{"title":"On Computational Indistinguishability and Logical Relations","authors":"Ugo Dal Lago, Zeinab Galal, Giulia Giusti","doi":"arxiv-2408.17340","DOIUrl":"https://doi.org/arxiv-2408.17340","url":null,"abstract":"A $lambda$-calculus is introduced in which all programs can be evaluated in\u0000probabilistic polynomial time and in which there is sufficient structure to\u0000represent sequential cryptographic constructions and adversaries for them, even\u0000when the latter are oracle-based. A notion of observational equivalence\u0000capturing computational indistinguishability and a class of approximate logical\u0000relations are then presented, showing that the latter represent a sound proof\u0000technique for the former. The work concludes with the presentation of an\u0000example of a security proof in which the encryption scheme induced by a\u0000pseudorandom function is proven secure against active adversaries in a purely\u0000equational style.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"27 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179547","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
We present a miniKanren-based type inferencer for an educational programming language with first-class functions, S-expressions, and pattern-matching. The language itself is untyped which adds a certain specificity to the problem and requires the employment of techniques conventionally used in implicit/gradual typing settings. The presence of polymorphic and recursive types poses a certain challenge when implementing the inferencer in miniKanren and requires a number of tricks, optimizations, and extensions to be used; we report on those as well.
{"title":"A Relational Solver for Constraint-based Type Inference","authors":"Eridan Domoratskiy, Dmitry Boulytchev","doi":"arxiv-2408.17138","DOIUrl":"https://doi.org/arxiv-2408.17138","url":null,"abstract":"We present a miniKanren-based type inferencer for an educational programming\u0000language with first-class functions, S-expressions, and pattern-matching. The\u0000language itself is untyped which adds a certain specificity to the problem and\u0000requires the employment of techniques conventionally used in implicit/gradual\u0000typing settings. The presence of polymorphic and recursive types poses a\u0000certain challenge when implementing the inferencer in miniKanren and requires a\u0000number of tricks, optimizations, and extensions to be used; we report on those\u0000as well.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"5 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179552","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Over the past decade, reactive frameworks and languages have become the dominant programming paradigm in front-end web development. In this paradigm, user actions change application state, and those changes propagate reactively to derived state and to the display, reducing the likelihood that various parts of the data model and user-facing view will become out of sync due to programmer error. In this paper, we explore the application of relational programming to the specification and synchronized evolution of model and view across time in response to user input. To that end, we present a reactive Javascript implementation of miniKanren and an integrated reactive programming model oriented towards the challenges of front-end web development.
{"title":"Relational Reactive Programming: miniKanren for the Web","authors":"Evan Donahue","doi":"arxiv-2408.17044","DOIUrl":"https://doi.org/arxiv-2408.17044","url":null,"abstract":"Over the past decade, reactive frameworks and languages have become the\u0000dominant programming paradigm in front-end web development. In this paradigm,\u0000user actions change application state, and those changes propagate reactively\u0000to derived state and to the display, reducing the likelihood that various parts\u0000of the data model and user-facing view will become out of sync due to\u0000programmer error. In this paper, we explore the application of relational\u0000programming to the specification and synchronized evolution of model and view\u0000across time in response to user input. To that end, we present a reactive\u0000Javascript implementation of miniKanren and an integrated reactive programming\u0000model oriented towards the challenges of front-end web development.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"1 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179548","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
We integrate integrity constraints to stableKanren to enable a new problem-solving paradigm in combinatorial search problems. stableKanren extends miniKanren to reasoning about contradictions under stable model semantics. However, writing programs to solve combinatorial search problems in stableKanren did not fully utilize the contradiction reasoning. This is mainly due to the lack of control over the predicate (goal function) outcome during resolution. Integrity constraints defined by answer set programming (ASP) provide the ability to constrain the predicate outcome. However, integrity constraints are headless normal clauses, and stableKanren cannot create a goal function without a valid head. There are two approaches to handling integrity constraints, but they do not fit stableKanren. Therefore, we design a new approach to integrate integrity constraints into stableKanren. We show a uniform framework to solve combinatorial search problems using integrity constraints in extended stableKanren.
{"title":"To Be or Not To Be: Adding Integrity Constraints to stableKanren to Make a Decision","authors":"Xiangyu Guo, Ajay Bansal","doi":"arxiv-2408.16699","DOIUrl":"https://doi.org/arxiv-2408.16699","url":null,"abstract":"We integrate integrity constraints to stableKanren to enable a new\u0000problem-solving paradigm in combinatorial search problems. stableKanren extends\u0000miniKanren to reasoning about contradictions under stable model semantics.\u0000However, writing programs to solve combinatorial search problems in\u0000stableKanren did not fully utilize the contradiction reasoning. This is mainly\u0000due to the lack of control over the predicate (goal function) outcome during\u0000resolution. Integrity constraints defined by answer set programming (ASP)\u0000provide the ability to constrain the predicate outcome. However, integrity\u0000constraints are headless normal clauses, and stableKanren cannot create a goal\u0000function without a valid head. There are two approaches to handling integrity\u0000constraints, but they do not fit stableKanren. Therefore, we design a new\u0000approach to integrate integrity constraints into stableKanren. We show a\u0000uniform framework to solve combinatorial search problems using integrity\u0000constraints in extended stableKanren.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"16 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-08-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179550","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
This paper explores options for implementing the relation $n equiv 0 (text{mod} 3)$ within miniKanren using miniKanren numbers and its arithmetic suite. We examine different approaches starting from straightforward implementations to more optimized versions. The implementations discussed include brute-force arithmetic methods, divisibility tricks, and derivation from a finite automaton. Our contributions include an in-depth look at the process of implementing a miniKanren relation and observations on benchmarking texttt{defrel}s. This study aims to provide practical insights for miniKanren programmers on both performance and implementation techniques.
{"title":"Six Ways to Implement Divisibility by Three in miniKanren","authors":"Brett Schreiber, Brysen Pfingsten, Jason Hemann","doi":"arxiv-2408.16259","DOIUrl":"https://doi.org/arxiv-2408.16259","url":null,"abstract":"This paper explores options for implementing the relation $n equiv 0 \u0000(text{mod} 3)$ within miniKanren using miniKanren numbers and its arithmetic\u0000suite. We examine different approaches starting from straightforward\u0000implementations to more optimized versions. The implementations discussed\u0000include brute-force arithmetic methods, divisibility tricks, and derivation\u0000from a finite automaton. Our contributions include an in-depth look at the\u0000process of implementing a miniKanren relation and observations on benchmarking\u0000texttt{defrel}s. This study aims to provide practical insights for miniKanren\u0000programmers on both performance and implementation techniques.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"1 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2024-08-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179553","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}