An embedding of B in Clojure

Philipp Körner, Florian Mager
{"title":"An embedding of B in Clojure","authors":"Philipp Körner, Florian Mager","doi":"10.1145/3550356.3561561","DOIUrl":null,"url":null,"abstract":"Considering programs as data enables powerful meta-programming. One example is Lisp's macro system, which gives rise to powerful transformations of programs and allows easy implementation of domain-specific languages. Formal specifications, however, usually do not rely on such mechanisms and are mostly written by hand in a textual format (or using specialised DSL tools). In this paper, we investigate the opportunities that stem from considering specifications as data. For this, we embedded the B specification language in Clojure, a modern Lisp. We use Clojure as a functional meta-programming language and the ProB Java API to capture the semantics of B, i.e., to find solutions for constraints or animate machines. From our experience, it is especially useful for tool development and generation of constraints and machines from external data sources. It can also be used to implement language extensions and to design domain-specific languages.","PeriodicalId":182662,"journal":{"name":"Proceedings of the 25th International Conference on Model Driven Engineering Languages and Systems: Companion Proceedings","volume":"31 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-10-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 25th International Conference on Model Driven Engineering Languages and Systems: Companion Proceedings","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3550356.3561561","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Considering programs as data enables powerful meta-programming. One example is Lisp's macro system, which gives rise to powerful transformations of programs and allows easy implementation of domain-specific languages. Formal specifications, however, usually do not rely on such mechanisms and are mostly written by hand in a textual format (or using specialised DSL tools). In this paper, we investigate the opportunities that stem from considering specifications as data. For this, we embedded the B specification language in Clojure, a modern Lisp. We use Clojure as a functional meta-programming language and the ProB Java API to capture the semantics of B, i.e., to find solutions for constraints or animate machines. From our experience, it is especially useful for tool development and generation of constraints and machines from external data sources. It can also be used to implement language extensions and to design domain-specific languages.
在Clojure中嵌入B
将程序视为数据可以实现强大的元编程。一个例子是Lisp的宏系统,它可以产生强大的程序转换,并允许轻松实现特定于领域的语言。然而,正式的规范通常不依赖于这样的机制,而主要是以文本格式手工编写的(或使用专门的DSL工具)。在本文中,我们调查了将规范视为数据的机会。为此,我们在Clojure(一种现代Lisp)中嵌入了B规范语言。我们使用Clojure作为函数式元编程语言,并使用ProB Java API来捕获B的语义,即为约束或动画机器找到解决方案。根据我们的经验,它对于工具开发和从外部数据源生成约束和机器特别有用。它还可以用于实现语言扩展和设计特定于领域的语言。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信