首页 > 最新文献

arXiv - CS - Programming Languages最新文献

英文 中文
To Be or Not To Be: Adding Integrity Constraints to stableKanren to Make a Decision 要还是不要:为稳定的 Kanren 添加完整性约束以做出决定
Pub Date : 2024-08-29 DOI: arxiv-2408.16699
Xiangyu Guo, Ajay Bansal
We integrate integrity constraints to stableKanren to enable a newproblem-solving paradigm in combinatorial search problems. stableKanren extendsminiKanren to reasoning about contradictions under stable model semantics.However, writing programs to solve combinatorial search problems instableKanren did not fully utilize the contradiction reasoning. This is mainlydue to the lack of control over the predicate (goal function) outcome duringresolution. Integrity constraints defined by answer set programming (ASP)provide the ability to constrain the predicate outcome. However, integrityconstraints are headless normal clauses, and stableKanren cannot create a goalfunction without a valid head. There are two approaches to handling integrityconstraints, but they do not fit stableKanren. Therefore, we design a newapproach to integrate integrity constraints into stableKanren. We show auniform framework to solve combinatorial search problems using integrityconstraints in extended stableKanren.
我们将完整性约束集成到了稳定坎仁算法中,从而在组合搜索问题中实现了一种新的问题解决范式。稳定坎仁算法将迷你坎仁算法扩展到了稳定模型语义下的矛盾推理。然而,编写程序来解决组合搜索问题时,不稳定坎仁算法并没有充分利用矛盾推理。这主要是由于在求解过程中缺乏对谓词(目标函数)结果的控制。由答案集编程(ASP)定义的完整性约束提供了约束谓词结果的能力。但是,完整性约束是无头正常从句,而稳定坎儿井无法创建没有有效头部的目标函数。有两种方法可以处理完整性约束,但它们并不适合稳定的 Kanren。因此,我们设计了一种新方法,将完整性约束集成到稳定坎儿井中。我们展示了在扩展稳定坎伦中使用完整性约束解决组合搜索问题的统一框架。
{"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":null,"pages":null},"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}
引用次数: 0
Improving stableKanren's Backward Compatibility 改进稳定版简体中文的向后兼容性
Pub Date : 2024-08-29 DOI: arxiv-2408.16257
Xiangyu Guo, Ajay Bansal
We improve the backward compatibility of stableKanren to run miniKanrenprograms. stableKanren is a miniKanren extension capable of non-monotonicreasoning through stable model semantics. However, standard miniKanren programsthat produce infinite results do not run as expected in stableKanren. Accordingto stable model semantics, the contradictions are created by negations. Astandard miniKanren's relations do not involve negation, and the coarsecontradictions handling in stableKanren causes this compatibility issue.Therefore, we provide a find-grinded contradiction handling to restrict thechecking scope. As a result, standard miniKanren relations can produce answers.We also add a ``run-partial'' interface so that standard miniKanren's relationsimplemented with ``define''/``defineo'' can generate answers even if theycoexist with non-terminating or unsatisfiable stableKanren relations in thesame environment. The ``run-partial'' interface also supports runningstratified negation programs faster without checking global unavoidablecontradictions. A dependency graph analysis can be applied to the input queryin the future, so the ``run'' interface can implicitly decide whether toperform unavoidable contradictions checking to improve usability.
我们改进了 stableKanren 的向后兼容性,使其能够运行 miniKanren 程序。stableKanren 是一个 miniKanren 扩展,能够通过稳定模型语义进行非单调推理。然而,产生无限结果的标准迷你坎儿井程序在稳定坎儿井中并不能像预期的那样运行。根据稳定模型语义,矛盾是由否定产生的。标准迷你坎儿井的关系并不涉及否定,而稳定坎儿井中粗略的矛盾处理会导致这个兼容性问题。我们还添加了一个 "运行-部分 "接口,这样,即使在同一环境中,标准迷你坎儿井关系与非终结或不可满足的稳定坎儿井关系共存,用 "定义"/"定义o "实现的标准迷你坎儿井关系也能生成答案。run-partial''接口还支持在不检查全局不可避免的矛盾的情况下更快地运行简化的否定程序。将来可以对输入查询进行依赖图分析,因此 "运行 "接口可以隐式地决定是否进行不可避免的矛盾检查,以提高可用性。
{"title":"Improving stableKanren's Backward Compatibility","authors":"Xiangyu Guo, Ajay Bansal","doi":"arxiv-2408.16257","DOIUrl":"https://doi.org/arxiv-2408.16257","url":null,"abstract":"We improve the backward compatibility of stableKanren to run miniKanren\u0000programs. stableKanren is a miniKanren extension capable of non-monotonic\u0000reasoning through stable model semantics. However, standard miniKanren programs\u0000that produce infinite results do not run as expected in stableKanren. According\u0000to stable model semantics, the contradictions are created by negations. A\u0000standard miniKanren's relations do not involve negation, and the coarse\u0000contradictions handling in stableKanren causes this compatibility issue.\u0000Therefore, we provide a find-grinded contradiction handling to restrict the\u0000checking scope. As a result, standard miniKanren relations can produce answers.\u0000We also add a ``run-partial'' interface so that standard miniKanren's relations\u0000implemented with ``define''/``defineo'' can generate answers even if they\u0000coexist with non-terminating or unsatisfiable stableKanren relations in the\u0000same environment. The ``run-partial'' interface also supports running\u0000stratified negation programs faster without checking global unavoidable\u0000contradictions. A dependency graph analysis can be applied to the input query\u0000in the future, so the ``run'' interface can implicitly decide whether to\u0000perform unavoidable contradictions checking to improve usability.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179551","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}
引用次数: 0
Six Ways to Implement Divisibility by Three in miniKanren 在 miniKanren 中实现三除法的六种方法
Pub Date : 2024-08-29 DOI: arxiv-2408.16259
Brett Schreiber, Brysen Pfingsten, Jason Hemann
This paper explores options for implementing the relation $n equiv 0 (text{mod} 3)$ within miniKanren using miniKanren numbers and its arithmeticsuite. We examine different approaches starting from straightforwardimplementations to more optimized versions. The implementations discussedinclude brute-force arithmetic methods, divisibility tricks, and derivationfrom a finite automaton. Our contributions include an in-depth look at theprocess of implementing a miniKanren relation and observations on benchmarkingtexttt{defrel}s. This study aims to provide practical insights for miniKanrenprogrammers on both performance and implementation techniques.
本文探讨了在 miniKanren 中使用 miniKanren 数字及其算术套件实现关系式 $n equiv 0 (text{mod} 3)$ 的方案。我们研究了从直接实现到更优化版本的不同方法。讨论的实现方法包括暴力算术法、可分性技巧以及从有限自动机推导。我们的贡献包括深入探讨了迷你坎伦关系的实现过程,以及对基准文本的观察。本研究旨在为迷你坎仁函数编程人员提供性能和实现技术方面的实用见解。
{"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":null,"pages":null},"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}
引用次数: 0
Omega: The Power of Visual Simplicity 欧米茄:视觉简约的力量
Pub Date : 2024-08-28 DOI: arxiv-2408.15631
Benoit SonntagLSIIT, Dominique ColnetKIWI
We are currently developing an innovative and visually-driven programminglanguage called Omega.Although the Omega code is stored in text files, thesefiles are not intended for manual editing or traditional printing.Furthermore,parsing these files using a context-free grammar is not possible.The parsing ofthe code and the facilitation of user-friendly manual editing both necessitatea global knowledge of the codebase.Strictly speaking, code visualization is notan integral part of the Omega language; instead, this task is delegated to theediting tools.Thanks to the global knowledge of the code, the editing processbecomes remarkably straightforward, with numerous automatic completion featuresthat enhance usability.Omega leverages a visual-oriented approach to encompassall fundamental aspects of software engineering.It offers robust features,including safe static typing, design by contracts, rules for accessing slots,operator definitions, and more,all presented in an intuitively and visuallycomprehensible manner, eliminating the need for obscure syntax.
虽然 Omega 代码存储在文本文件中,但这些文件并不用于手动编辑或传统的打印,此外,使用无上下文语法来解析这些文件也是不可能的。严格来说,代码可视化并不是 Omega 语言的组成部分;相反,这项任务被委托给了编辑工具。Omega 利用面向视觉的方法涵盖了软件工程的所有基本方面。它提供了强大的功能,包括安全静态类型、合约设计、访问插槽的规则、运算符定义等,所有这些都以直观、可视化的方式呈现,无需使用晦涩难懂的语法。
{"title":"Omega: The Power of Visual Simplicity","authors":"Benoit SonntagLSIIT, Dominique ColnetKIWI","doi":"arxiv-2408.15631","DOIUrl":"https://doi.org/arxiv-2408.15631","url":null,"abstract":"We are currently developing an innovative and visually-driven programming\u0000language called Omega.Although the Omega code is stored in text files, these\u0000files are not intended for manual editing or traditional printing.Furthermore,\u0000parsing these files using a context-free grammar is not possible.The parsing of\u0000the code and the facilitation of user-friendly manual editing both necessitate\u0000a global knowledge of the codebase.Strictly speaking, code visualization is not\u0000an integral part of the Omega language; instead, this task is delegated to the\u0000editing tools.Thanks to the global knowledge of the code, the editing process\u0000becomes remarkably straightforward, with numerous automatic completion features\u0000that enhance usability.Omega leverages a visual-oriented approach to encompass\u0000all fundamental aspects of software engineering.It offers robust features,\u0000including safe static typing, design by contracts, rules for accessing slots,\u0000operator definitions, and more,all presented in an intuitively and visually\u0000comprehensible manner, eliminating the need for obscure syntax.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142223613","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}
引用次数: 0
Verifying Solutions to Semantics-Guided Synthesis Problems 验证语义引导合成问题的解决方案
Pub Date : 2024-08-28 DOI: arxiv-2408.15475
Charlie Murphy, Keith Johnson, Thomas Reps, Loris D'Antoni
Semantics-Guided Synthesis (SemGuS) provides a framework to specify synthesisproblems in a solver-agnostic and domain-agnostic way, by allowing a user toprovide both the syntax and semantics of the language in which the desiredprogram should be synthesized. Because synthesis and verification are closelyintertwined, the SemGuS framework raises the problem of how to verify programsin a solver and domain-agnostic way. We prove that the problem of verifying whether a program is a valid solutionto a SemGuS problem can be reduced to proving validity of a query in the `CLPcalculus, a fixed-point logic that generalizes Constrained Horn Clauses andco-Constrained Horn Clauses. Our encoding into `CLP allows us to furtherclassify the SemGuS verification problems into ones that are reducible tovalidity of (i) first-order-logic formulas, (ii) Constrained Horn Clauses,(iii) co-Constrained Horn Clauses, and (iv) `CLP queries. Furthermore, ourencoding shines light on some limitations of the SemGuS framework, such as itsinability to model nondeterminism and reactive synthesis. We thus propose amodification to SemGuS that makes it more expressive, and for which verifyingsolutions is exactly equivalent to proving validity of a query in the `CLPcalculus. Our implementation of SemGuS verifiers based on the above encodingcan verify instances that were not even encodable in previous work.Furthermore, we use our SemGuS verifiers within an enumeration-based SemGuSsolver to correctly synthesize solutions to SemGuS problems that no previousSemGuS synthesizer could solve.
语义指导合成(Semantics-Guided Synthesis,SemGuS)提供了一种框架,允许用户同时提供合成所需程序的语言的语法和语义,从而以与求解器和领域无关的方式指定合成问题。由于综合与验证紧密相连,SemGuS 框架提出了如何以与求解器和领域无关的方式验证程序的问题。我们证明,验证程序是否是SemGuS问题的有效解决方案的问题可以简化为证明`CLP微积分(Constrained Horn Clauses andco-Constrained Horn Clauses)中查询的有效性。我们对 "CLP "的编码使我们能够将SemGuS验证问题进一步分类为可还原为以下几种有效性的问题:(1)一阶逻辑公式;(2)约束Horn子句;(3)共约束Horn子句;以及(4)"CLP "查询。此外,我们的编码还揭示了SemGuS框架的一些局限性,比如它无法模拟非确定性和反应式合成。因此,我们提出了对SemGuS的修改,使其更具表现力,对它来说,验证解决方案完全等同于证明CLP微积分中查询的有效性。此外,我们在基于枚举的SemGuS求解器(SemGuSsolver)中使用我们的SemGuS验证器,正确地合成出以前的SemGuS合成器无法解决的SemGuS问题的解决方案。
{"title":"Verifying Solutions to Semantics-Guided Synthesis Problems","authors":"Charlie Murphy, Keith Johnson, Thomas Reps, Loris D'Antoni","doi":"arxiv-2408.15475","DOIUrl":"https://doi.org/arxiv-2408.15475","url":null,"abstract":"Semantics-Guided Synthesis (SemGuS) provides a framework to specify synthesis\u0000problems in a solver-agnostic and domain-agnostic way, by allowing a user to\u0000provide both the syntax and semantics of the language in which the desired\u0000program should be synthesized. Because synthesis and verification are closely\u0000intertwined, the SemGuS framework raises the problem of how to verify programs\u0000in a solver and domain-agnostic way. We prove that the problem of verifying whether a program is a valid solution\u0000to a SemGuS problem can be reduced to proving validity of a query in the `CLP\u0000calculus, a fixed-point logic that generalizes Constrained Horn Clauses and\u0000co-Constrained Horn Clauses. Our encoding into `CLP allows us to further\u0000classify the SemGuS verification problems into ones that are reducible to\u0000validity of (i) first-order-logic formulas, (ii) Constrained Horn Clauses,\u0000(iii) co-Constrained Horn Clauses, and (iv) `CLP queries. Furthermore, our\u0000encoding shines light on some limitations of the SemGuS framework, such as its\u0000inability to model nondeterminism and reactive synthesis. We thus propose a\u0000modification to SemGuS that makes it more expressive, and for which verifying\u0000solutions is exactly equivalent to proving validity of a query in the `CLP\u0000calculus. Our implementation of SemGuS verifiers based on the above encoding\u0000can verify instances that were not even encodable in previous work.\u0000Furthermore, we use our SemGuS verifiers within an enumeration-based SemGuS\u0000solver to correctly synthesize solutions to SemGuS problems that no previous\u0000SemGuS synthesizer could solve.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179554","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}
引用次数: 0
Automating Pruning in Top-Down Enumeration for Program Synthesis Problems with Monotonic Semantics 在单调语义的程序合成问题自顶向下枚举中自动剪枝
Pub Date : 2024-08-28 DOI: arxiv-2408.15822
Keith J. C. Johnson, Rahul Krishnan, Thomas Reps, Loris D'Antoni
In top-down enumeration for program synthesis, abstraction-based pruning usesan abstract domain to approximate the set of possible values that a partialprogram, when completed, can output on a given input. If the set does notcontain the desired output, the partial program and all its possiblecompletions can be pruned. In its general form, abstraction-based pruningrequires manually designed, domain-specific abstract domains and semantics, andthus has only been used in domain-specific synthesizers. This paper provides sufficient conditions under which a form ofabstraction-based pruning can be automated for arbitrary synthesis problems inthe general-purpose Semantics-Guided Synthesis (SemGuS) framework withoutrequiring manually-defined abstract domains. We show that if the semantics ofthe language for which we are synthesizing programs exhibits some monotonicityproperties, one can obtain an abstract interval-based semantics for free fromthe concrete semantics of the programming language, and use such semantics toeffectively prune the search space. We also identify a condition that ensuressuch abstract semantics can be used to compute a precise abstraction of the setof values that a program derivable from a given hole in a partial program canproduce. These precise abstractions make abstraction-based pruning moreeffective. We implement our approach in a tool, Moito, which can tackle synthesisproblems defined in the SemGuS framework. Moito can automate interval-basedpruning without any a-priori knowledge of the problem domain, and solvesynthesis problems that previously required domain-specific, abstraction-basedsynthesizers -- e.g., synthesis of regular expressions, CSV file schema, andimperative programs from examples.
在用于程序综合的自顶向下枚举中,基于抽象的剪枝使用一个抽象域来近似估计部分程序在完成后可在给定输入上输出的可能值集合。如果该集合不包含所需的输出,则可以剪枝该部分程序及其所有可能的完成。一般来说,基于抽象的剪枝需要人工设计特定领域的抽象域和语义,因此只在特定领域的合成器中使用过。本文提供了充分条件,在这些条件下,通用语义引导合成(Semantics-Guided Synthesis,SemGuS)框架中的任意合成问题都可以自动实现基于抽象的剪枝,而无需人工定义抽象域。我们的研究表明,如果我们正在合成程序的语言的语义表现出某些单调性特性,我们就可以从编程语言的具体语义中免费获得基于区间的抽象语义,并利用这种语义有效地剪裁搜索空间。我们还确定了一个条件,确保抽象语义可用于计算部分程序中给定洞可派生程序所能产生的值集的精确抽象。这些精确的抽象使得基于抽象的剪枝更加有效。我们在工具 Moito 中实现了我们的方法,它可以处理 SemGuS 框架中定义的综合问题。Moito 可以自动进行基于区间的剪枝,而不需要任何关于问题领域的先验知识,并且可以解决以前需要特定领域、基于抽象的合成器才能解决的合成问题--例如,正则表达式、CSV 文件模式和示例中的交互式程序的合成。
{"title":"Automating Pruning in Top-Down Enumeration for Program Synthesis Problems with Monotonic Semantics","authors":"Keith J. C. Johnson, Rahul Krishnan, Thomas Reps, Loris D'Antoni","doi":"arxiv-2408.15822","DOIUrl":"https://doi.org/arxiv-2408.15822","url":null,"abstract":"In top-down enumeration for program synthesis, abstraction-based pruning uses\u0000an abstract domain to approximate the set of possible values that a partial\u0000program, when completed, can output on a given input. If the set does not\u0000contain the desired output, the partial program and all its possible\u0000completions can be pruned. In its general form, abstraction-based pruning\u0000requires manually designed, domain-specific abstract domains and semantics, and\u0000thus has only been used in domain-specific synthesizers. This paper provides sufficient conditions under which a form of\u0000abstraction-based pruning can be automated for arbitrary synthesis problems in\u0000the general-purpose Semantics-Guided Synthesis (SemGuS) framework without\u0000requiring manually-defined abstract domains. We show that if the semantics of\u0000the language for which we are synthesizing programs exhibits some monotonicity\u0000properties, one can obtain an abstract interval-based semantics for free from\u0000the concrete semantics of the programming language, and use such semantics to\u0000effectively prune the search space. We also identify a condition that ensures\u0000such abstract semantics can be used to compute a precise abstraction of the set\u0000of values that a program derivable from a given hole in a partial program can\u0000produce. These precise abstractions make abstraction-based pruning more\u0000effective. We implement our approach in a tool, Moito, which can tackle synthesis\u0000problems defined in the SemGuS framework. Moito can automate interval-based\u0000pruning without any a-priori knowledge of the problem domain, and solve\u0000synthesis problems that previously required domain-specific, abstraction-based\u0000synthesizers -- e.g., synthesis of regular expressions, CSV file schema, and\u0000imperative programs from examples.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179555","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}
引用次数: 0
Galley: Modern Query Optimization for Sparse Tensor Programs Galley:稀疏张量程序的现代查询优化
Pub Date : 2024-08-27 DOI: arxiv-2408.14706
Kyle Deeds, Willow Ahrens, Magda Balazinska, Dan Suciu
The tensor programming abstraction has become the key . This framework allowsusers to write high performance programs for bulk computation via a high-levelimperative interface. Recent work has extended this paradigm to sparse tensors(i.e. tensors where most entries are not explicitly represented) with the useof sparse tensor compilers. These systems excel at producing efficient code forcomputation over sparse tensors, which may be stored in a wide variety offormats. However, they require the user to manually choose the order ofoperations and the data formats at every step. Unfortunately, these decisionsare both highly impactful and complicated, requiring significant effort tomanually optimize. In this work, we present Galley, a system for declarativesparse tensor programming. Galley performs cost-based optimization to lowerthese programs to a logical plan then to a physical plan. It then leveragessparse tensor compilers to execute the physical plan efficiently. We show thatGalley achieves high performance on a wide variety of problems includingmachine learning algorithms, subgraph counting, and iterative graph algorithms.
张量编程抽象已成为.NET技术的关键。这一框架允许用户通过高级操作界面编写用于批量计算的高性能程序。最近的研究利用稀疏张量编译器将这一范式扩展到了稀疏张量(即大部分条目没有明确表示的张量)。这些系统擅长为稀疏张量的计算生成高效代码,稀疏张量可以以多种格式存储。然而,它们要求用户在每一步都手动选择操作顺序和数据格式。遗憾的是,这些决定既影响大又复杂,需要花费大量精力手动优化。在这项工作中,我们提出了一个用于声明解析张量编程的系统 Galley。Galley 执行基于成本的优化,将这些程序降低为逻辑计划,然后再降低为物理计划。然后,它利用稀疏张量编译器高效执行物理计划。我们的研究表明,Galley 在包括机器学习算法、子图计数和迭代图算法在内的各种问题上都取得了很高的性能。
{"title":"Galley: Modern Query Optimization for Sparse Tensor Programs","authors":"Kyle Deeds, Willow Ahrens, Magda Balazinska, Dan Suciu","doi":"arxiv-2408.14706","DOIUrl":"https://doi.org/arxiv-2408.14706","url":null,"abstract":"The tensor programming abstraction has become the key . This framework allows\u0000users to write high performance programs for bulk computation via a high-level\u0000imperative interface. Recent work has extended this paradigm to sparse tensors\u0000(i.e. tensors where most entries are not explicitly represented) with the use\u0000of sparse tensor compilers. These systems excel at producing efficient code for\u0000computation over sparse tensors, which may be stored in a wide variety of\u0000formats. However, they require the user to manually choose the order of\u0000operations and the data formats at every step. Unfortunately, these decisions\u0000are both highly impactful and complicated, requiring significant effort to\u0000manually optimize. In this work, we present Galley, a system for declarative\u0000sparse tensor programming. Galley performs cost-based optimization to lower\u0000these programs to a logical plan then to a physical plan. It then leverages\u0000sparse tensor compilers to execute the physical plan efficiently. We show that\u0000Galley achieves high performance on a wide variety of problems including\u0000machine learning algorithms, subgraph counting, and iterative graph algorithms.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179557","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}
引用次数: 0
Generation of Compiler Backends from Formal Models of Hardware 从硬件的形式化模型生成编译器后端
Pub Date : 2024-08-27 DOI: arxiv-2408.15429
Gus Henry Smith
Compilers convert between representations -- usually, from higher-level,human writable code to lower-level, machine-readable code. A compiler backendis the portion of the compiler containing optimizations and code generationroutines for a specific hardware target. In this dissertation, I advocate for aspecific way of building compiler backends: namely, by automatically generatingthem from explicit, formal models of hardware using automated reasoningalgorithms. I describe how automatically generating compilers from formalmodels of hardware leads to increased optimization ability, strongercorrectness guarantees, and reduced development time for compiler backends. Asevidence, I present two case studies: first, Glenside, which uses equalitysaturation to increase the 3LA compiler's ability to offload operations tomachine learning accelerators, and second, Lakeroad, a technology mapper forFPGAs which uses program synthesis and semantics extracted from Verilog to maphardware designs to complex, programmable hardware primitives.
编译器在各种表示法之间进行转换,通常是从高级的、人类可写的代码转换为低级的、机器可读的代码。编译器后端是编译器中包含针对特定硬件目标的优化和代码生成程序的部分。在这篇论文中,我主张采用一种特定的方式来构建编译器后端:即使用自动推理算法从硬件的显式形式模型中自动生成编译器后端。我描述了如何从硬件的形式化模型自动生成编译器,从而提高优化能力、加强正确性保证并缩短编译器后端开发时间。作为例证,我介绍了两个案例研究:第一,Glenside,它使用相等饱和度来提高 3LA 编译器向机器学习加速器卸载操作的能力;第二,Lakeroad,一种用于FPGA 的技术映射器,它使用从 Verilog 中提取的程序综合和语义将硬件设计映射到复杂的可编程硬件基元。
{"title":"Generation of Compiler Backends from Formal Models of Hardware","authors":"Gus Henry Smith","doi":"arxiv-2408.15429","DOIUrl":"https://doi.org/arxiv-2408.15429","url":null,"abstract":"Compilers convert between representations -- usually, from higher-level,\u0000human writable code to lower-level, machine-readable code. A compiler backend\u0000is the portion of the compiler containing optimizations and code generation\u0000routines for a specific hardware target. In this dissertation, I advocate for a\u0000specific way of building compiler backends: namely, by automatically generating\u0000them from explicit, formal models of hardware using automated reasoning\u0000algorithms. I describe how automatically generating compilers from formal\u0000models of hardware leads to increased optimization ability, stronger\u0000correctness guarantees, and reduced development time for compiler backends. As\u0000evidence, I present two case studies: first, Glenside, which uses equality\u0000saturation to increase the 3LA compiler's ability to offload operations to\u0000machine learning accelerators, and second, Lakeroad, a technology mapper for\u0000FPGAs which uses program synthesis and semantics extracted from Verilog to map\u0000hardware designs to complex, programmable hardware primitives.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142223614","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}
引用次数: 0
Synthesizing Formal Semantics from Executable Interpreters 从可执行解释器合成形式语义
Pub Date : 2024-08-26 DOI: arxiv-2408.14668
Jiangyi Liu, Charlie Murphy, Anvay Grover, Keith J. C. Johnson, Thomas Reps, Loris D'Antoni
Program verification and synthesis frameworks that allow one to customize thelanguage in which one is interested typically require the user to provide aformally defined semantics for the language. Because writing a formal semantics can be a daunting and error-prone task,this requirement stands in the way of such frameworks being adopted bynon-expert users. We present an algorithm that can automatically synthesize inductively definedsyntax-directed semantics when given (i) a grammar describing the syntax of alanguage and (ii) an executable (closed-box) interpreter for computing thesemantics of programs in the language of the grammar. Our algorithm synthesizes the semantics in the form of Constrained-HornClauses (CHCs), a natural, extensible, and formal logical framework forspecifying inductively defined relations that has recently received widespreadadoption in program verification and synthesis. The key innovation of our synthesis algorithm is a Counterexample-GuidedSynthesis (CEGIS) approach that breaks the hard problem of synthesizing a setof constrained Horn clauses into small, tractable expression-synthesis problemsthat can be dispatched to existing SyGuS synthesizers. Our tool Synantic synthesized inductively-defined formal semantics from 14interpreters for languages used in program-synthesis applications. When synthesizing formal semantics for one of our benchmarks, Synanticunveiled an inconsistency in the semantics computed by the interpreter for alanguage of regular expressions; fixing the inconsistency resulted in a moreefficient semantics and, for some cases, in a 1.2x speedup for a synthesizersolving synthesis problems over such a language.
程序验证和综合框架允许用户定制自己感兴趣的语言,但通常要求用户为语言提供正式定义的语义。由于编写正式语义是一项艰巨且容易出错的任务,这一要求阻碍了此类框架被非专业用户采用。我们提出了一种算法,当给定(i)描述语言语法的语法和(ii)在语法语言中计算程序语义的可执行(封闭盒)解释器时,它可以自动合成归纳定义的语法导向语义。我们的算法以约束角式语句(CHC)的形式合成语义,这是一种自然、可扩展的正式逻辑框架,用于指定归纳定义的关系,最近在程序验证和合成中得到了广泛应用。我们的合成算法的关键创新点在于反例引导合成(Counterexample-GuidedSynthesis,CEGIS)方法,它将合成一组受限霍恩子句的难题分解成小而易懂的表达式合成问题,这些问题可以分派给现有的 SyGuS 合成器。我们的工具 Synantic 从程序合成应用中使用的 14 种语言解释器中合成了归纳定义的形式语义。在为我们的一个基准合成形式语义时,Synantic 发现解释器为正则表达式语言计算的语义存在不一致性;修正不一致性后,语义效率更高,在某些情况下,合成器解决这种语言合成问题的速度提高了 1.2 倍。
{"title":"Synthesizing Formal Semantics from Executable Interpreters","authors":"Jiangyi Liu, Charlie Murphy, Anvay Grover, Keith J. C. Johnson, Thomas Reps, Loris D'Antoni","doi":"arxiv-2408.14668","DOIUrl":"https://doi.org/arxiv-2408.14668","url":null,"abstract":"Program verification and synthesis frameworks that allow one to customize the\u0000language in which one is interested typically require the user to provide a\u0000formally defined semantics for the language. Because writing a formal semantics can be a daunting and error-prone task,\u0000this requirement stands in the way of such frameworks being adopted by\u0000non-expert users. We present an algorithm that can automatically synthesize inductively defined\u0000syntax-directed semantics when given (i) a grammar describing the syntax of a\u0000language and (ii) an executable (closed-box) interpreter for computing the\u0000semantics of programs in the language of the grammar. Our algorithm synthesizes the semantics in the form of Constrained-Horn\u0000Clauses (CHCs), a natural, extensible, and formal logical framework for\u0000specifying inductively defined relations that has recently received widespread\u0000adoption in program verification and synthesis. The key innovation of our synthesis algorithm is a Counterexample-Guided\u0000Synthesis (CEGIS) approach that breaks the hard problem of synthesizing a set\u0000of constrained Horn clauses into small, tractable expression-synthesis problems\u0000that can be dispatched to existing SyGuS synthesizers. Our tool Synantic synthesized inductively-defined formal semantics from 14\u0000interpreters for languages used in program-synthesis applications. When synthesizing formal semantics for one of our benchmarks, Synantic\u0000unveiled an inconsistency in the semantics computed by the interpreter for a\u0000language of regular expressions; fixing the inconsistency resulted in a more\u0000efficient semantics and, for some cases, in a 1.2x speedup for a synthesizer\u0000solving synthesis problems over such a language.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179556","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}
引用次数: 0
MetaFFI -- Multilingual Indirect Interoperability System MetaFFI -- 多语言间接互操作系统
Pub Date : 2024-08-26 DOI: arxiv-2408.14175
Tsvi Cherny-Shahar, Amiram Yehudai
The development of software applications using multiple programming languageshas increased in recent years, as it allows the selection of the most suitablelanguage and runtime for each component of the system and the integration ofthird-party libraries. However, this practice involves complexity and errorproneness, due to the absence of an adequate system for the interoperability ofmultiple programming languages. Developers are compelled to resort toworkarounds, such as library reimplementation or language-specific wrappers,which are often dependent on C as the common denominator for interoperability.These challenges render the use of multiple programming languages a burdensomeand demanding task that necessitates highly skilled developers forimplementation, debugging, and maintenance, and raise doubts about the benefitsof interoperability. To overcome these challenges, we propose MetaFFI, apluggable in-process indirect-interoperability system that allows the loadingand utilization of entities from multiple programming languages. This isachieved by exploiting the less restrictive shallow binding mechanisms (e.g.,Foreign Function Interface) to offer deep binding features (e.g., objectcreation, methods, fields). MetaFFI provides a runtime-independent framework toload and emph{xcall} (Cross-Call) foreign entities (e.g., functions, objects).MetaFFI uses Common Data Types (CDTs) to pass parameters and return values,including objects and complex types, and even cross-language callbacks. Theindirect interoperability approach of MetaFFI has the significant advantage ofrequiring only $2n$ mechanisms to support $n$ languages, as opposed to thedirect interoperability approaches that need $n^2$ mechanisms. We havesuccessfully tested the binding between Go, Python3.11, and Java in aproof-of-concept on Windows and Ubuntu.
近年来,使用多种编程语言开发应用软件的情况越来越多,因为这样可以为系统的每个组件选择最合适的语言和运行时间,并集成第三方库。然而,由于缺乏适当的系统来实现多种编程语言的互操作性,这种做法既复杂又容易出错。这些挑战使使用多种编程语言成为一项繁重而艰巨的任务,需要高技能的开发人员来实现、调试和维护,并使人们对互操作性的好处产生怀疑。为了克服这些挑战,我们提出了 MetaFFI,这是一个可插拔的进程内间接互操作系统,允许加载和使用来自多种编程语言的实体。这是通过利用限制较少的浅层绑定机制(如外来函数接口)来提供深层绑定功能(如对象创建、方法、字段)来实现的。MetaFFI 提供了一个独立于运行时的框架,用于加载和调用(Cross-Call)外来实体(如函数、对象)。MetaFFI 使用通用数据类型(Common Data Types,CDT)来传递参数和返回值,包括对象和复杂类型,甚至是跨语言回调。与需要 n^2 种机制的直接互操作方法相比,MetaFFI 的直接互操作方法的显著优势在于只需要 2n$ 种机制来支持 n$ 种语言。我们已经在 Windows 和 Ubuntu 上成功测试了 Go、Python3.11 和 Java 之间的概念验证绑定。
{"title":"MetaFFI -- Multilingual Indirect Interoperability System","authors":"Tsvi Cherny-Shahar, Amiram Yehudai","doi":"arxiv-2408.14175","DOIUrl":"https://doi.org/arxiv-2408.14175","url":null,"abstract":"The development of software applications using multiple programming languages\u0000has increased in recent years, as it allows the selection of the most suitable\u0000language and runtime for each component of the system and the integration of\u0000third-party libraries. However, this practice involves complexity and error\u0000proneness, due to the absence of an adequate system for the interoperability of\u0000multiple programming languages. Developers are compelled to resort to\u0000workarounds, such as library reimplementation or language-specific wrappers,\u0000which are often dependent on C as the common denominator for interoperability.\u0000These challenges render the use of multiple programming languages a burdensome\u0000and demanding task that necessitates highly skilled developers for\u0000implementation, debugging, and maintenance, and raise doubts about the benefits\u0000of interoperability. To overcome these challenges, we propose MetaFFI, a\u0000pluggable in-process indirect-interoperability system that allows the loading\u0000and utilization of entities from multiple programming languages. This is\u0000achieved by exploiting the less restrictive shallow binding mechanisms (e.g.,\u0000Foreign Function Interface) to offer deep binding features (e.g., object\u0000creation, methods, fields). MetaFFI provides a runtime-independent framework to\u0000load and emph{xcall} (Cross-Call) foreign entities (e.g., functions, objects).\u0000MetaFFI uses Common Data Types (CDTs) to pass parameters and return values,\u0000including objects and complex types, and even cross-language callbacks. The\u0000indirect interoperability approach of MetaFFI has the significant advantage of\u0000requiring only $2n$ mechanisms to support $n$ languages, as opposed to the\u0000direct interoperability approaches that need $n^2$ mechanisms. We have\u0000successfully tested the binding between Go, Python3.11, and Java in a\u0000proof-of-concept on Windows and Ubuntu.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179559","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}
引用次数: 0
期刊
arXiv - CS - Programming Languages
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1