arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2403.00170cs.SEcs.PL
收藏

AlloyASG:作为紧凑结构平衡图的 Alloy 谓词代码表示

AlloyASG: Alloy Predicate Code Representation as a Compact Structurally Balanced Graph

Guanxuan Wu, Allison Sullivan

AI总结:

本文提出复杂结构平衡抽象语义图(CSBASG)来表示 Alloy 谓词代码,以解决 AST 因重复节点导致的数据指数增长问题,并验证其在紧凑性和谓词比较上的优势,为代码生成与自动修复提供基础。

摘要:

编写声明式模型具有诸多益处,既包括在系统构建之前对设计级性质进行自动推理和修正,也包括在系统构建之后对其实现进行自动测试和调试。然而,要获得这些益处,模型本身必须是正确的。Alloy 是一种常用的建模语言,已有若干现有工作致力于自动修复有缺陷的模型。目前,这些工作都是基于搜索的方法,使用模型的抽象语法树(AST)表示,并且不具备可扩展性。其中一个问题是,AST 本身在数据规模上会呈指数级增长,原因在于 AST 往往会在树中单独列出大量相同的节点。为了解决这一问题,我们提出了一种新颖的代码表示模式,即复杂结构平衡抽象语义图(CSBASG),它将代码表示为一个复数加权有向图,把语义元素列为图中的节点,并确保其对几乎有限可枚举的代码段具有结构平衡性。我们针对 Alloy 模型评估了 CSBASG 表示在相对于 AST 的紧凑性方面的效率,并探索了 CSBASG 是否能够简化两个 Alloy 谓词的比较过程。此外,基于这一表示,我们确定了 CSBASG 的若干未来应用,包括 Alloy 代码生成和自动修复。

英文摘要:

Writing declarative models has numerous benefits, ranging from automated reasoning and correction of design-level properties before systems are built to automated testing and debugging of their implementations after they are built. Unfortunately, the model itself needs to be correct to gain these benefits. Alloy is a commonly used modeling language that has several existing efforts to repair faulty models automatically. Currently, these efforts are search-based methods that use an Abstract Syntax Tree (AST) representation of the model and do not scale. One issue is that ASTs themselves suffer from exponential growth in their data size due to the limitation that ASTs will often have identical nodes separately listed in the tree. To address this issue, we introduce a novel code representation schema, Complex Structurally Balanced Abstract Semantic Graph (CSBASG), which represents code as a complex-weighted directed graph that lists a semantic element as a node in the graph and ensures its structural balance for almost finitely enumerable code segments. We evaluate the efficiency of our CSBASG representation for Alloy models in terms of it's compactness compared to ASTs, and we explore if a CSBASG can ease the process of comparing two Alloy predicates. Moreover, with this representation in place, we identify several future applications of CSBASG, including Alloy code generation and automated repair.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑