首页 > 最新文献

arXiv - CS - Programming Languages最新文献

英文 中文
Empowering LLMs for Verilog Generation through Multi-Level Summarization 通过多层次总结为 Verilog 生成赋予 LLM 能力
Pub Date : 2024-07-15 DOI: arxiv-2407.10424
Yang Zhao, Di Huang, Chongxiao Li, Pengwei Jin, Ziyuan Nan, Tianyun Ma, Lei Qi, Yansong Pan, Zhenxing Zhang, Rui Zhang, Xishan Zhang, Zidong Du, Qi Guo, Xing Hu, Yunji Chen
The increasing complexity and high costs associated with modern processordesign have led to a surge in demand for processor design automation.Instruction-tuned large language models (LLMs) have demonstrated remarkableperformance in automatically generating code for general-purpose programminglanguages like Python. However, these methods fail on hardware descriptionlanguages (HDLs) like Verilog due to the scarcity of high-quality instructiontuning data, as even advanced LLMs like GPT-3.5 exhibit limited performance onVerilog generation. Regarding this issue, we observe that (1) Verilog codecollected from the real world has higher quality than those generated by LLMs.(2) LLMs like GPT-3.5 excel in summarizing Verilog code rather than generatingit. Based on these observations, this paper introduces CodeV, a series ofopen-source instruction-tuned Verilog generation LLMs. Instead of generatingdescriptions first and then getting the corresponding code from advanced LLMs,we prompt the LLM with Verilog code and let the LLM generate the correspondingnatural language description by multi-level summarization. Experimental resultsshow that CodeV relatively surpasses the previous open-source SOTA by 14.4%(BetterV in VerilogEval) and 11.3% (RTLCoder in RTLLM) respectively, and alsorelatively outperforms previous commercial SOTA GPT-4 by 22.1% in VerilogEval.
现代工艺设计的复杂性和高成本不断增加,导致对处理器设计自动化的需求激增。指令调谐大型语言模型(LLM)在为 Python 等通用编程语言自动生成代码方面表现出色。然而,由于高质量指令调谐数据的稀缺,这些方法在 Verilog 等硬件描述语言(HDL)上失效了,因为即使是 GPT-3.5 这样先进的 LLM,在 Verilog 生成上也表现出有限的性能。关于这个问题,我们观察到:(1) 从现实世界中收集的 Verilog 代码比 LLM 生成的代码质量更高;(2) GPT-3.5 等 LLM 擅长总结 Verilog 代码,而不是生成 Verilog 代码。基于这些观察结果,本文介绍了 CodeV,一系列开源指令调整的 Verilog 生成 LLM。我们不是先生成描述,然后再从高级 LLM 获取相应的代码,而是用 Verilog 代码提示 LLM,让 LLM 通过多级总结生成相应的自然语言描述。实验结果表明,CodeV分别以14.4%(VerilogEval中的BetterV)和11.3%(RTLLM中的RTLCoder)的成绩超过了之前的开源SOTA,在VerilogEval中以22.1%的成绩超过了之前的商业SOTA GPT-4。
{"title":"Empowering LLMs for Verilog Generation through Multi-Level Summarization","authors":"Yang Zhao, Di Huang, Chongxiao Li, Pengwei Jin, Ziyuan Nan, Tianyun Ma, Lei Qi, Yansong Pan, Zhenxing Zhang, Rui Zhang, Xishan Zhang, Zidong Du, Qi Guo, Xing Hu, Yunji Chen","doi":"arxiv-2407.10424","DOIUrl":"https://doi.org/arxiv-2407.10424","url":null,"abstract":"The increasing complexity and high costs associated with modern processor\u0000design have led to a surge in demand for processor design automation.\u0000Instruction-tuned large language models (LLMs) have demonstrated remarkable\u0000performance in automatically generating code for general-purpose programming\u0000languages like Python. However, these methods fail on hardware description\u0000languages (HDLs) like Verilog due to the scarcity of high-quality instruction\u0000tuning data, as even advanced LLMs like GPT-3.5 exhibit limited performance on\u0000Verilog generation. Regarding this issue, we observe that (1) Verilog code\u0000collected from the real world has higher quality than those generated by LLMs.\u0000(2) LLMs like GPT-3.5 excel in summarizing Verilog code rather than generating\u0000it. Based on these observations, this paper introduces CodeV, a series of\u0000open-source instruction-tuned Verilog generation LLMs. Instead of generating\u0000descriptions first and then getting the corresponding code from advanced LLMs,\u0000we prompt the LLM with Verilog code and let the LLM generate the corresponding\u0000natural language description by multi-level summarization. Experimental results\u0000show that CodeV relatively surpasses the previous open-source SOTA by 14.4%\u0000(BetterV in VerilogEval) and 11.3% (RTLCoder in RTLLM) respectively, and also\u0000relatively outperforms previous commercial SOTA GPT-4 by 22.1% in VerilogEval.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141718893","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
Curriculum Learning for Small Code Language Models 小代码语言模型的课程学习
Pub Date : 2024-07-14 DOI: arxiv-2407.10194
Marwa Naïr, Kamel Yamani, Lynda Said Lhadj, Riyadh Baghdadi
Code language models have emerged as useful tools for various programmingtasks, yet they often struggle when it comes to complex ones. In this paper, weexplore the potential of curriculum learning in enhancing the performance ofthese models. While prior research has suggested that curriculum learning doesnot necessarily help in improving the performance of language models, ourresults surprisingly show that this may not be the case for code languagemodels. We demonstrate that a well-designed curriculum learning approachsignificantly improves the accuracy of small decoder-only code language modelson the task of code execution, while its effect on code completion is lesssignificant. To explore the potential of curriculum learning, we train multipleGPT models with 1 million parameters each to predict the next token andevaluate them on code completion and execution tasks. Our contributions includeproposing a novel code difficulty assessment metric by combining software codemeasures, investigating the effectiveness of Curriculum Learning for codelanguage models, and introducing a Novel Curriculum Learning schedule thatenhances the performance of small decoder-only language models in codeexecution tasks. The results of this paper open the door for more research onthe use of curriculum learning for code language models.
代码语言模型已成为各种编程任务的有用工具,但它们在处理复杂任务时往往会遇到困难。在本文中,我们探讨了课程学习在提高这些模型性能方面的潜力。以往的研究表明,课程学习并不一定有助于提高语言模型的性能,而我们的研究结果却出人意料地表明,代码语言模型的情况可能并非如此。我们证明,精心设计的课程学习方法可以显著提高小型纯解码器代码语言模型在代码执行任务上的准确性,而其对代码完成的影响则不那么显著。为了探索课程学习的潜力,我们训练了多个 GPT 模型,每个模型有 100 万个参数,用于预测下一个标记,并在代码完成和执行任务中对它们进行了评估。我们的贡献包括:结合软件代码测量方法提出了一种新的代码难度评估指标,研究了课程学习对代码语言模型的有效性,并介绍了一种新的课程学习计划,该计划可提高小型纯解码器语言模型在代码执行任务中的性能。本文的研究成果为更多关于将课程学习用于代码语言模型的研究打开了大门。
{"title":"Curriculum Learning for Small Code Language Models","authors":"Marwa Naïr, Kamel Yamani, Lynda Said Lhadj, Riyadh Baghdadi","doi":"arxiv-2407.10194","DOIUrl":"https://doi.org/arxiv-2407.10194","url":null,"abstract":"Code language models have emerged as useful tools for various programming\u0000tasks, yet they often struggle when it comes to complex ones. In this paper, we\u0000explore the potential of curriculum learning in enhancing the performance of\u0000these models. While prior research has suggested that curriculum learning does\u0000not necessarily help in improving the performance of language models, our\u0000results surprisingly show that this may not be the case for code language\u0000models. We demonstrate that a well-designed curriculum learning approach\u0000significantly improves the accuracy of small decoder-only code language models\u0000on the task of code execution, while its effect on code completion is less\u0000significant. To explore the potential of curriculum learning, we train multiple\u0000GPT models with 1 million parameters each to predict the next token and\u0000evaluate them on code completion and execution tasks. Our contributions include\u0000proposing a novel code difficulty assessment metric by combining software code\u0000measures, investigating the effectiveness of Curriculum Learning for code\u0000language models, and introducing a Novel Curriculum Learning schedule that\u0000enhances the performance of small decoder-only language models in code\u0000execution tasks. The results of this paper open the door for more research on\u0000the use of curriculum learning for code language models.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141718892","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
Defining Name Accessibility using Scope Graphs (Extended Edition) 使用范围图定义名称的可访问性(扩展版)
Pub Date : 2024-07-12 DOI: arxiv-2407.09320
Aron Zwaan, Casper Bach Poulsen
Many programming languages allow programmers to regulate accessibility; i.e.,annotating a declaration with keywords such as export and private to indicatewhere it can be accessed. Despite the importance of name accessibility for,e.g., compilers, editor auto-completion and tooling, and automatedrefactorings, few existing type systems provide a formal account of nameaccessibility. We present a declarative, executable, and language-parametric model for nameaccessibility, which provides a formal specification of name accessibility inJava, C#, C++, Rust, and Eiffel. We achieve this by defining name accessibilityas a predicate on resolution paths through scope graphs. Since scope graphs area language-independent model of name resolution, our model provides a uniformapproach to defining different accessibility policies for different languages. Our model is implemented in Statix, a logic language for executable typesystem specification using scope graphs. We evaluate its correctness on a testsuite that compares it with the C#, Java, and Rust compilers, and show we cansynthesize access modifiers in programs with holes accurately.
许多编程语言都允许程序员规范名称的可访问性,即用关键字(如 export 和 private)对声明进行注释,以指明可以在何处访问该声明。尽管名称的可访问性对于编译器、编辑器自动补全和工具以及自动重构等都很重要,但很少有现有的类型系统能对名称的可访问性做出正式说明。我们提出了一种声明式、可执行和语言参数化的名称可访问性模型,它提供了 Java、C#、C++、Rust 和 Eiffel 中名称可访问性的正式规范。为此,我们将名称可访问性定义为通过作用域图的解析路径的谓词。由于作用域图是一种与语言无关的名称解析模型,因此我们的模型提供了一种统一的方法来为不同语言定义不同的可访问性策略。我们的模型是在 Statix 中实现的,Statix 是一种使用作用域图进行可执行类型系统规范的逻辑语言。我们在一个测试套件中评估了该模型的正确性,并将其与 C#、Java 和 Rust 编译器进行了比较,结果表明我们可以在程序中精确合成带洞的访问修饰符。
{"title":"Defining Name Accessibility using Scope Graphs (Extended Edition)","authors":"Aron Zwaan, Casper Bach Poulsen","doi":"arxiv-2407.09320","DOIUrl":"https://doi.org/arxiv-2407.09320","url":null,"abstract":"Many programming languages allow programmers to regulate accessibility; i.e.,\u0000annotating a declaration with keywords such as export and private to indicate\u0000where it can be accessed. Despite the importance of name accessibility for,\u0000e.g., compilers, editor auto-completion and tooling, and automated\u0000refactorings, few existing type systems provide a formal account of name\u0000accessibility. We present a declarative, executable, and language-parametric model for name\u0000accessibility, which provides a formal specification of name accessibility in\u0000Java, C#, C++, Rust, and Eiffel. We achieve this by defining name accessibility\u0000as a predicate on resolution paths through scope graphs. Since scope graphs are\u0000a language-independent model of name resolution, our model provides a uniform\u0000approach to defining different accessibility policies for different languages. Our model is implemented in Statix, a logic language for executable type\u0000system specification using scope graphs. We evaluate its correctness on a test\u0000suite that compares it with the C#, Java, and Rust compilers, and show we can\u0000synthesize access modifiers in programs with holes accurately.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141722173","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
Refinements for Multiparty Message-Passing Protocols: Specification-agnostic theory and implementation 多方消息传递协议的改进:与规范无关的理论与实现
Pub Date : 2024-07-12 DOI: arxiv-2407.09106
Vassor Martin, Yoshida Nobuko
Multiparty message-passing protocols are notoriously difficult to design, dueto interaction mismatches that lead to errors such as deadlocks. Existingprotocol specification formats have been developed to prevent such errors (e.g.multiparty session types (MPST)). In order to further constrain protocols,specifications can be extended with refinements, i.e. logical predicates tocontrol the behaviour of the protocol based on previous values exchanged.Unfortunately, existing refinement theories and implementations are tightlycoupled with specification formats. This paper proposes a framework formultiparty message-passing protocols with refinements and its implementation inRust. Our work decouples correctness of refinements from the underlying modelof computation, which results in a specification-agnostic framework. Ourcontributions are threefold. First, we introduce a trace system whichcharacterises valid refined traces, i.e. a sequence of sending and receivingactions correct with respect to refinements. Second, we give a correct model ofcomputation named refined communicating system (RCS), which is an extension ofcommunicating automata systems with refinements. We prove that RCS only producevalid refined traces. We show how to generate RCS from mainstream protocolspecification formats, such as refined multiparty session types (RMPST) orrefined choreography automata. Third, we illustrate the flexibility of theframework by developing both a static analysis technique and an improved modelof computation for dynamic refinement evaluation. Finally, we provide a Rusttoolchain for decentralised RMPST, evaluate our implementation with a set ofbenchmarks from the literature, and observe that refinement overhead isnegligible.
众所周知,多方消息传递协议很难设计,因为交互不匹配会导致死锁等错误。现有的协议规范格式(如多方会话类型(MPST))就是为防止此类错误而开发的。为了进一步约束协议,可以用细化(即根据先前交换的值来控制协议行为的逻辑谓词)来扩展规范。本文提出了一个具有细化功能的多方消息传递协议框架及其在 Rust 中的实现。我们的工作将细化的正确性与底层计算模型解耦,从而产生了一个与规范无关的框架。我们的贡献有三方面。首先,我们引入了一个描述有效精炼轨迹的轨迹系统,即与精炼相关的正确的发送和接收操作序列。其次,我们给出了一个正确的计算模型,命名为精炼通信系统(RCS),它是具有精炼的通信自动机系统的扩展。我们证明了 RCS 只产生有效的细化轨迹。我们展示了如何从主流协议规范格式生成 RCS,如精炼多方会话类型(RMPST)或精炼编排自动机。第三,我们通过开发静态分析技术和改进的动态细化评估计算模型,展示了框架的灵活性。最后,我们为去中心化的 RMPST 提供了一个 Rust 工具链,用一组文献中的基准来评估我们的实现,并观察到细化开销微不足道。
{"title":"Refinements for Multiparty Message-Passing Protocols: Specification-agnostic theory and implementation","authors":"Vassor Martin, Yoshida Nobuko","doi":"arxiv-2407.09106","DOIUrl":"https://doi.org/arxiv-2407.09106","url":null,"abstract":"Multiparty message-passing protocols are notoriously difficult to design, due\u0000to interaction mismatches that lead to errors such as deadlocks. Existing\u0000protocol specification formats have been developed to prevent such errors (e.g.\u0000multiparty session types (MPST)). In order to further constrain protocols,\u0000specifications can be extended with refinements, i.e. logical predicates to\u0000control the behaviour of the protocol based on previous values exchanged.\u0000Unfortunately, existing refinement theories and implementations are tightly\u0000coupled with specification formats. This paper proposes a framework for\u0000multiparty message-passing protocols with refinements and its implementation in\u0000Rust. Our work decouples correctness of refinements from the underlying model\u0000of computation, which results in a specification-agnostic framework. Our\u0000contributions are threefold. First, we introduce a trace system which\u0000characterises valid refined traces, i.e. a sequence of sending and receiving\u0000actions correct with respect to refinements. Second, we give a correct model of\u0000computation named refined communicating system (RCS), which is an extension of\u0000communicating automata systems with refinements. We prove that RCS only produce\u0000valid refined traces. We show how to generate RCS from mainstream protocol\u0000specification formats, such as refined multiparty session types (RMPST) or\u0000refined choreography automata. Third, we illustrate the flexibility of the\u0000framework by developing both a static analysis technique and an improved model\u0000of computation for dynamic refinement evaluation. Finally, we provide a Rust\u0000toolchain for decentralised RMPST, evaluate our implementation with a set of\u0000benchmarks from the literature, and observe that refinement overhead is\u0000negligible.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141718894","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
Higher-Order Specificationsfor Deductive Synthesis of Programs with Pointers (Extended version) 带指针程序演绎合成的高阶规范(扩展版)
Pub Date : 2024-07-12 DOI: arxiv-2407.09143
David Young, Ziyi Yang, Ilya Sergey, Alex Potanin
Synthetic Separation Logic (SSL) is a formalism that powers SuSLik, thestate-of-the-art approach for the deductive synthesis of provably-correctprograms in C-like languages that manipulate Heap-based linked data structures.Despite its expressivity, SSL suffers from two shortcomings that hinder itsutility. First, its main specification component, inductive predicates, onlyadmits emph{first-order} definitions of data structure shapes, which leads tothe proliferation of ``boiler-plate'' predicates for specifying commonpatterns. Second, SSL requires emph{concrete} definitions of data structuresto synthesise programs that manipulate them, which results in the need tochange a specification for a synthesis task every time changes are introducedinto the layout of the involved structures. We propose to significantly lift the level of abstraction used in writingSeparation Logic specifications for synthesis -- both simplifying the approachand making the specifications more usable and easy to read and follow. We avoidthe need to repetitively re-state low-level representation details throughoutthe specifications -- allowing the reuse of different implementations of thesame data structure by abstracting away the details of a specific layout usedin memory. Our novel textit{high-level front-end language} called Pikasignificantly improves the expressiveness of SuSLik. We implemented a layout-agnostic synthesiser from Pika to SuSLik enablingpush-button synthesis of C programs with in-place memory updates, along withthe accompanying full proofs that they meet Separation Logic-stylespecifications, from high-level specifications that resemble ordinaryfunctional programs. Our experiments show that our tool can produce C code thatis comparable in its performance characteristics and is sometimes faster thanHaskell.
合成分离逻辑(Synthetic Separation Logic,简称 SSL)是为 SuSLik 提供支持的一种形式主义,SuSLik 是一种最先进的方法,用于在类 C 语言中以演绎法合成可证明正确的程序,这些程序可操作基于堆的链接数据结构。首先,它的主要规范组件--归纳谓词,只允许对数据结构形状进行 "emph{first-order}"定义,这导致了用于指定常见模式的 "boiler-plate "谓词的激增。其次,SSL要求对数据结构进行 "emph{具体}"定义,以便综合处理这些数据结构的程序,这就导致每当相关结构的布局发生变化时,都需要更改综合任务的规范。我们建议大幅提升编写用于合成的分离逻辑规范的抽象程度--既简化方法,又使规范更可用、更易读和易遵循。我们避免了在整个规范中重复陈述低层次表示细节的需要--通过抽象掉内存中使用的特定布局细节,允许重复使用相同数据结构的不同实现。我们名为 Pikas 的新颖前端语言(textit{high-level front-end language})极大地提高了 SuSLik 的表现力。我们实现了一个从Pika到SuSLik的布局无关合成器,它可以一键合成具有就地内存更新功能的C语言程序,并附带完整的证明,证明这些程序符合分离逻辑风格的规范,而这些规范来自与普通功能程序类似的高级规范。我们的实验表明,我们的工具可以生成性能相当的 C 代码,有时甚至比 Haskell 更快。
{"title":"Higher-Order Specificationsfor Deductive Synthesis of Programs with Pointers (Extended version)","authors":"David Young, Ziyi Yang, Ilya Sergey, Alex Potanin","doi":"arxiv-2407.09143","DOIUrl":"https://doi.org/arxiv-2407.09143","url":null,"abstract":"Synthetic Separation Logic (SSL) is a formalism that powers SuSLik, the\u0000state-of-the-art approach for the deductive synthesis of provably-correct\u0000programs in C-like languages that manipulate Heap-based linked data structures.\u0000Despite its expressivity, SSL suffers from two shortcomings that hinder its\u0000utility. First, its main specification component, inductive predicates, only\u0000admits emph{first-order} definitions of data structure shapes, which leads to\u0000the proliferation of ``boiler-plate'' predicates for specifying common\u0000patterns. Second, SSL requires emph{concrete} definitions of data structures\u0000to synthesise programs that manipulate them, which results in the need to\u0000change a specification for a synthesis task every time changes are introduced\u0000into the layout of the involved structures. We propose to significantly lift the level of abstraction used in writing\u0000Separation Logic specifications for synthesis -- both simplifying the approach\u0000and making the specifications more usable and easy to read and follow. We avoid\u0000the need to repetitively re-state low-level representation details throughout\u0000the specifications -- allowing the reuse of different implementations of the\u0000same data structure by abstracting away the details of a specific layout used\u0000in memory. Our novel textit{high-level front-end language} called Pika\u0000significantly improves the expressiveness of SuSLik. We implemented a layout-agnostic synthesiser from Pika to SuSLik enabling\u0000push-button synthesis of C programs with in-place memory updates, along with\u0000the accompanying full proofs that they meet Separation Logic-style\u0000specifications, from high-level specifications that resemble ordinary\u0000functional programs. Our experiments show that our tool can produce C code that\u0000is comparable in its performance characteristics and is sometimes faster than\u0000Haskell.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141722174","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
Pragmatics of Formally Verified Yet Efficient Static Analysis, in particular for Formally Verified Compilers 形式验证但高效静态分析的实用性,尤其是针对形式验证编译器的静态分析
Pub Date : 2024-07-11 DOI: arxiv-2407.08258
David MonniauxVERIMAG - IMAG
Formally verified compilers and formally verified static analyzers are asolution to the problem that certain industries face when they have todemonstrate to authorities that the object code they run truly corresponds toits source code and that it satisfies certain properties. From a scientific andtechnological point of view, they are a challenge: not only a number ofnontrivial invariants and algorithms must be proved to be correct, but also theimplementation must be reasonably effective so that the tools operate withinreasonable time. Many optimizations in compilers rely on static analysis, andthus a formally verified compiler entails formally verified static analyses.Inthis article, we explain some difficulties, possible solutions, design choicesand trade-offs pertaining to verified static analysis, in particular when thesolution of the analysis is expressed as some form of tree, map or set.
正式验证的编译器和正式验证的静态分析器可以解决某些行业所面临的问题,即它们必须向权威机构证明所运行的目标代码真正对应于其源代码,并满足某些属性。从科学和技术的角度来看,它们是一项挑战:不仅要证明许多非琐碎的不变式和算法是正确的,而且实施必须合理有效,以便工具能在合理的时间内运行。编译器中的许多优化都依赖于静态分析,因此一个经过形式验证的编译器需要经过形式验证的静态分析。在本文中,我们将解释与经过验证的静态分析有关的一些困难、可能的解决方案、设计选择和权衡,特别是当分析的解决方案以某种形式的树、映射或集合表示时。
{"title":"Pragmatics of Formally Verified Yet Efficient Static Analysis, in particular for Formally Verified Compilers","authors":"David MonniauxVERIMAG - IMAG","doi":"arxiv-2407.08258","DOIUrl":"https://doi.org/arxiv-2407.08258","url":null,"abstract":"Formally verified compilers and formally verified static analyzers are a\u0000solution to the problem that certain industries face when they have to\u0000demonstrate to authorities that the object code they run truly corresponds to\u0000its source code and that it satisfies certain properties. From a scientific and\u0000technological point of view, they are a challenge: not only a number of\u0000nontrivial invariants and algorithms must be proved to be correct, but also the\u0000implementation must be reasonably effective so that the tools operate within\u0000reasonable time. Many optimizations in compilers rely on static analysis, and\u0000thus a formally verified compiler entails formally verified static analyses.In\u0000this article, we explain some difficulties, possible solutions, design choices\u0000and trade-offs pertaining to verified static analysis, in particular when the\u0000solution of the analysis is expressed as some form of tree, map or set.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141609517","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
Functional Programming in Learning Electromagnetic Theory 学习电磁理论中的函数式编程
Pub Date : 2024-07-10 DOI: arxiv-2407.08090
Scott N. WalckLebanon Valley College
Electromagnetic theory is central to physics. An undergraduate major inphysics typically takes a semester or a year of electromagnetic theory as ajunior or senior, and a graduate student in physics typically takes anadditional semester or year at a more advanced level. In fall 2023, the authortaught his undergraduate electricity and magnetism class using numericalmethods in Haskell in parallel with traditional analytical methods. Thisarticle describes what functional programming has to offer to physics ingeneral, and electromagnetic theory in particular. We give examples from vectorcalculus, the mathematical language in which electromagnetic theory isexpressed, and electromagnetic theory itself.
电磁理论是物理学的核心。物理学专业的本科生在大三或大四时通常会学习一学期或一年的电磁理论,而物理学专业的研究生通常会在更高年级再学习一学期或一年的电磁理论。2023 年秋季,作者在教授本科生电学和磁学课程时,将 Haskell 中的数值方法与传统的分析方法并行使用。本文介绍了函数式编程对物理学,尤其是电磁理论的贡献。我们举例说明了矢量微积分、表达电磁理论的数学语言以及电磁理论本身。
{"title":"Functional Programming in Learning Electromagnetic Theory","authors":"Scott N. WalckLebanon Valley College","doi":"arxiv-2407.08090","DOIUrl":"https://doi.org/arxiv-2407.08090","url":null,"abstract":"Electromagnetic theory is central to physics. An undergraduate major in\u0000physics typically takes a semester or a year of electromagnetic theory as a\u0000junior or senior, and a graduate student in physics typically takes an\u0000additional semester or year at a more advanced level. In fall 2023, the author\u0000taught his undergraduate electricity and magnetism class using numerical\u0000methods in Haskell in parallel with traditional analytical methods. This\u0000article describes what functional programming has to offer to physics in\u0000general, and electromagnetic theory in particular. We give examples from vector\u0000calculus, the mathematical language in which electromagnetic theory is\u0000expressed, and electromagnetic theory itself.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141609515","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
Mover Logic: A Concurrent Program Logic for Reduction and Rely-Guarantee Reasoning (Extended Version) Mover Logic:用于还原和可靠保证推理的并行程序逻辑(扩展版)
Pub Date : 2024-07-10 DOI: arxiv-2407.08070
Cormac Flanagan, Stephen N. Freund
Rely-guarantee (RG) logic uses thread interference specifications (relies andguarantees) to reason about the correctness of multithreaded software.Unfortunately, RG logic requires each function postcondition to be "stabilized"or specialized to the behavior of other threads, making it difficult to writefunction specifications that are reusable at multiple call sites. This paper presents mover logic, which extends RG logic to address thisproblem via the notion of atomic functions. Atomic functions behave as if theyexecute serially without interference from concurrent threads, and so they canbe assigned more general and reusable specifications that avoid thestabilization requirement of RG logic. Several practical verifiers (Calvin-R,QED, CIVL, Armada, Anchor, etc.) have demonstrated the modularity benefits ofatomic function specifications. However, the complexity of these systems andtheir correctness proofs makes it challenging to understand and extend thesesystems. Mover logic formalizes the central ideas reduction in a declarativeprogram logic that may provide foundation for future work in this area.
依赖-保证(RG)逻辑使用线程干扰规范(依赖和保证)来推理多线程软件的正确性。不幸的是,RG 逻辑要求每个函数的后置条件都必须 "稳定 "或专门针对其他线程的行为,这使得编写可在多个调用站点重复使用的函数规范变得非常困难。本文介绍了 "移动者逻辑",它通过原子函数的概念扩展了 RG 逻辑,以解决这一问题。原子函数的行为就像它们串行执行一样,不受并发线程的干扰,因此它们可以被赋予更通用、更可重用的规范,从而避免了 RG 逻辑的稳定要求。一些实用验证器(Calvin-R、QED、CIVL、Armada、Anchor 等)已经证明了原子函数规范的模块化优势。然而,这些系统及其正确性证明的复杂性使得理解和扩展这些系统具有挑战性。Mover 逻辑将中心思想还原形式化为一种声明式程序逻辑,为这一领域未来的工作奠定了基础。
{"title":"Mover Logic: A Concurrent Program Logic for Reduction and Rely-Guarantee Reasoning (Extended Version)","authors":"Cormac Flanagan, Stephen N. Freund","doi":"arxiv-2407.08070","DOIUrl":"https://doi.org/arxiv-2407.08070","url":null,"abstract":"Rely-guarantee (RG) logic uses thread interference specifications (relies and\u0000guarantees) to reason about the correctness of multithreaded software.\u0000Unfortunately, RG logic requires each function postcondition to be \"stabilized\"\u0000or specialized to the behavior of other threads, making it difficult to write\u0000function specifications that are reusable at multiple call sites. This paper presents mover logic, which extends RG logic to address this\u0000problem via the notion of atomic functions. Atomic functions behave as if they\u0000execute serially without interference from concurrent threads, and so they can\u0000be assigned more general and reusable specifications that avoid the\u0000stabilization requirement of RG logic. Several practical verifiers (Calvin-R,\u0000QED, CIVL, Armada, Anchor, etc.) have demonstrated the modularity benefits of\u0000atomic function specifications. However, the complexity of these systems and\u0000their correctness proofs makes it challenging to understand and extend these\u0000systems. Mover logic formalizes the central ideas reduction in a declarative\u0000program logic that may provide foundation for future work in this area.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141609516","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
A Systematic Mapping Study on Teaching of Security Concepts in Programming Courses 程序设计课程中安全概念教学的系统映射研究
Pub Date : 2024-07-10 DOI: arxiv-2407.07511
Alina Torbunova, Adnan Ashraf, Ivan Porres
Context: To effectively defend against ever-evolving cybersecurity threats,software systems should be made as secure as possible. To achieve this,software developers should understand potential vulnerabilities and applysecure coding practices. To prepare these skilled professionals, it isimportant that cybersecurity concepts are included in programming coursestaught at universities. Objective: To present a comprehensive and unbiasedliterature review on teaching of cybersecurity concepts in programming coursestaught at universities. Method: We perform a Systematic Mapping Study. Wepresent six research questions, define our selection criteria, and develop aclassification scheme. Results and Conclusions: We select 24 publications. Ourresults show a wide range of research contributions. We also outline guidelinesand identify opportunities for future studies. The guidelines include coverageof security knowledge categories and evaluation of contributions. We suggestthat future studies should cover security issues, negative impacts, andcountermeasures, as well as apply evaluation techniques that examine students'knowledge. The opportunities for future studies are related to advancedcourses, security knowledge frameworks, and programming environments.Furthermore, there is a need of a holistic security framework that covers thesecurity concepts identified in this study and is suitable for education.
背景:为了有效抵御不断变化的网络安全威胁,软件系统应尽可能安全。为此,软件开发人员应了解潜在的漏洞,并采用安全的编码实践。为了培养这些技能娴熟的专业人员,将网络安全概念纳入大学的编程课程非常重要。目标:对大学编程课程中的网络安全概念教学进行全面、公正的文献综述。方法:我们开展了一项系统制图研究。我们提出了六个研究问题,确定了选择标准,并制定了分类方案。结果与结论:我们选择了 24 篇出版物。我们的结果表明,研究贡献范围广泛。我们还概述了指导方针,并确定了未来研究的机会。指导方针包括安全知识类别的覆盖范围和对贡献的评估。我们建议,未来的研究应涵盖安全问题、负面影响和对策,并应用评估技术来检查学生的知识。未来研究的机会与高级课程、安全知识框架和编程环境有关。此外,还需要一个涵盖本研究中确定的这些安全概念并适合教育的整体安全框架。
{"title":"A Systematic Mapping Study on Teaching of Security Concepts in Programming Courses","authors":"Alina Torbunova, Adnan Ashraf, Ivan Porres","doi":"arxiv-2407.07511","DOIUrl":"https://doi.org/arxiv-2407.07511","url":null,"abstract":"Context: To effectively defend against ever-evolving cybersecurity threats,\u0000software systems should be made as secure as possible. To achieve this,\u0000software developers should understand potential vulnerabilities and apply\u0000secure coding practices. To prepare these skilled professionals, it is\u0000important that cybersecurity concepts are included in programming courses\u0000taught at universities. Objective: To present a comprehensive and unbiased\u0000literature review on teaching of cybersecurity concepts in programming courses\u0000taught at universities. Method: We perform a Systematic Mapping Study. We\u0000present six research questions, define our selection criteria, and develop a\u0000classification scheme. Results and Conclusions: We select 24 publications. Our\u0000results show a wide range of research contributions. We also outline guidelines\u0000and identify opportunities for future studies. The guidelines include coverage\u0000of security knowledge categories and evaluation of contributions. We suggest\u0000that future studies should cover security issues, negative impacts, and\u0000countermeasures, as well as apply evaluation techniques that examine students'\u0000knowledge. The opportunities for future studies are related to advanced\u0000courses, security knowledge frameworks, and programming environments.\u0000Furthermore, there is a need of a holistic security framework that covers the\u0000security concepts identified in this study and is suitable for education.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141587028","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
Programming Language Case Studies Can Be Deep 编程语言案例研究可以很深入
Pub Date : 2024-07-10 DOI: arxiv-2407.08091
Rose BohrerWorcester Polytechnic Institute
In the pedagogy of programming languages, one well-known course structure isto tour multiple languages as a means of touring paradigms. Thistour-of-paradigms approach has long received criticism as lacking depth,distracting students from foundational issues in language theory andimplementation. This paper argues for disentangling the idea of atour-of-languages from the tour-of-paradigms. We make this argument bypresenting, in depth, a series of case studies included in the Human-CenteredProgramming Languages curriculum. In this curriculum, case studies become deep,serving to tour the different intellectual foundations through which a scholarcan approach programming languages, which one could call the tour-of-humans. Inparticular, the design aspect of programming languages has much to learn fromthe social sciences and humanities, yet these intellectual foundations wouldyield far fewer deep contributions if we did not permit them to employ casestudies.
在编程语言教学法中,一种著名的课程结构是将多种语言作为范例进行巡回讲解。长期以来,"游范式 "教学法一直受到批评,被认为缺乏深度,分散了学生对语言理论和实现的基础性问题的注意力。本文主张将 "语言之旅 "的理念与 "范式之旅 "区分开来。我们通过深入介绍 "以人为本的语言编程 "课程中的一系列案例研究来提出这一观点。在这门课程中,案例研究变得更加深入,学者可以通过案例研究了解编程语言的不同知识基础,我们可以称之为 "人类之旅"。特别是,编程语言的设计方面可以从社会科学和人文学科中学到很多东西,然而,如果我们不允许他们使用案例研究,这些知识基础所产生的深层次贡献就会少得多。
{"title":"Programming Language Case Studies Can Be Deep","authors":"Rose BohrerWorcester Polytechnic Institute","doi":"arxiv-2407.08091","DOIUrl":"https://doi.org/arxiv-2407.08091","url":null,"abstract":"In the pedagogy of programming languages, one well-known course structure is\u0000to tour multiple languages as a means of touring paradigms. This\u0000tour-of-paradigms approach has long received criticism as lacking depth,\u0000distracting students from foundational issues in language theory and\u0000implementation. This paper argues for disentangling the idea of a\u0000tour-of-languages from the tour-of-paradigms. We make this argument by\u0000presenting, in depth, a series of case studies included in the Human-Centered\u0000Programming Languages curriculum. In this curriculum, case studies become deep,\u0000serving to tour the different intellectual foundations through which a scholar\u0000can approach programming languages, which one could call the tour-of-humans. In\u0000particular, the design aspect of programming languages has much to learn from\u0000the social sciences and humanities, yet these intellectual foundations would\u0000yield far fewer deep contributions if we did not permit them to employ case\u0000studies.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-07-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141609513","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