The prevalence of memory safety vulnerabilities in contemporary software systems has made the adoption of memory-safe programming languages increasingly critical. Among the available options, borrow checking, introduced by the Rust programming language, offers a compelling balance between safety and performance by enforcing disciplined ownership and reference semantics at compile time. However, further formalisation and refinement of the underlying framework is necessary, particularly to enhance its precision in the presence of flow-sensitive programming patterns. In this paper, we propose a novel reinterpretation of Rust's borrow checking mechanism as a form of abstract interpretation over a dedicated intermediate representation (IR). Our methodology captures the aliasing and initialisation properties of variables through the construction of abstract program traces that enable fine-grained, path-sensitive verification of memory safety properties. We formalise the syntax and operational semantics of the IR and develop a sound type system that enforces origin-based constraints on references. Through a series of examples, we show how our framework can successfully validate programs that are rejected by Rust's current implementation due to conservative approximations. By decoupling borrow checking from Rust's surface syntax and embedding it within a language-agnostic IR, our work lays the foundation for integrating Rust-style memory safety into a broader class of programming languages and compiler infrastructures.
Model checking is a powerful technique for software verification. However, the approach notably suffers from the infamous state space explosion problem. To tackle this, in this paper, we introduce a novel symbolic method for encoding Petri net markings. It is based on the use of generalised intervals on vectors, as opposed to existing methods based on vectors of intervals such as Interval Decision Diagrams. We develop a formalisation of these intervals, show that they possess homomorphic operations for model checking CTL on Petri nets, and define a canonical form that provides good performance characteristics. Our structure facilitates the symbolic evaluation of CTL formulas in the realm of global model checking, which aims to identify every state that satisfies a formula. Tests on examples of the model checking contest (MCC 2022) show that our approach yields promising results. To achieve this, we implement efficient computations based on saturation principles derived from other symbolic model checking techniques.
Wikidata is a knowledge graph increasingly adopted by many communities for diverse applications. Wikidata statements are annotated with qualifier-value pairs that are used to depict information, such as the validity context of the statement, its causality, provenances, etc. Handling the qualifiers in reasoning is a challenging problem. When defining inference rules (in particular, rules on ontological properties (x subclass of y, z instance of x, etc.)), one must consider the qualifiers, as most of them participate in the semantics of the statements. This poses a complex problem because a) there is a massive number of qualifiers, and b) the qualifiers of the inferred statement are often a combination of the qualifiers in the rule condition. In this work, we propose to address this problem by a) defining a categorization of the qualifiers b) formalizing the Wikidata model with a many-sorted logical language; the sorts of this language are the qualifier categories. We couple this logic with an algebraic specification that provides a means for effectively handling qualifiers in inference rules. Using Wikidata ontological properties, we show how to use the MSL and specification to reason on qualifiers. Finally, we discuss the methodology for practically implementing the work and present a prototype implementation. The work can be naturally extended, thanks to the extensibility of the many-sorted algebraic specification, to cover more qualifiers in the specification, such as uncertain time, recurring events, geographic locations, and others.
Memory safety checking seeks to protect programs from a wide spectrum of software problems related to memory access and management, such as using unallocated or uninitialized buffers.Despite decades of research, it remains an active and fruitful research topic, as issues of scalability and adoption continue to present open challenges.A popular approach to overcome these obstacles is to rely on type checking.Types are arguably one of the most scalable techniques to reason about a program's structural properties.They also offer a convenient tool to impose restrictions on source code, either to prohibit undesirable behaviors or to facilitate other analyses.Within the plethora of type systems that have been proposed to combat memory bugs, one recurrent trend is to leverage uniqueness and/or immutability to limit the impact of mutation, to support local reasoning.Unfortunately, bringing these properties to existing languages is often met with a deterring engineering effort.Unlike many other features and mechanisms, these are difficult to encode within a host language via simple syntactic extensions or clever meta-programming.Instead, they require a deeper understanding of the program's semantics, which can only be obtained through preliminary analysis.This paper presents results in our effort to address this difficulty.We introduce Fuel, a compiler framework designed to guarantee uniqueness and immutability properties in arbitrary programs with explicit memory management.Fuel is centered around a source and platform agnostic low-level intermediate representation, equipped with a capability-based type system, which can be targeted by compilers for higher level languages.It is able to guarantee freedom from invalid dereference and duplicate deallocations, and offers partial support to detect memory leaks.It also advocates for the use of dynamic checks to recover static type assumptions in places where static reasoning is either impractical or impossible.We present Fuel informally through a short series of examples and formalize a subset of its intermediate language.
Flow-sensitive type systems offer an elegant way to ensure memory-safety in programming languages. Unfortunately, their adoption in new or existing languages is often hindered by a painful effort to implement or integrate them into compilers. This paper presents early results in our effort to alleviate this task. We introduce Fuel, a type capability-based library that can be plugged onto a compiler toolchain to check for memory-safety properties. Fuel builds upon well-established ideas in the domain of capability-based system, and adds a mechanism leveraging dynamic checks to recover capabilities where static reasoning is either too difficult or impossible. This approach allows the analysis to potentially cover situations where a typical type system might not be expressive enough to statically reason about memory safety.
Hybrid systems modelling remains a very popular topic within the modelling and simulation community. Its expressiveness allows for the definition of highly complex systems that merge discrete-state-based transitions systems with continuous value-evolutions for variables, so that cyber-physical systems can be modelled in all their intricacies. This expressive power, however, comes at a downside of complex models and undecidable verification problems even for small systems. In this chapter we present CREST, a novel modelling language for the definition of hybrid systems. CREST merges features from various formalisms and languages such as hybrid automata, dataflow programming and internal domain-specific modelling language (DSML) designs to create simple yet powerful language for the modelling of resource flows within small-scale CPS such as automated gardening applications and smart homes. The language provides an easy to learn graphical interface and is supported by a Python-based tool implementation that allows for the efficient modelling, simulation and verification of CPS models.
By bridging the semantic gap, domain-specific language (DSLs) serve an important role in the conquest to allow domain experts to model their systems themselves. In this publication we present a case study of the development of the Continuous REactive SysTems language (CREST), a DSL for hybrid systems modeling. The language focuses on the representation of continuous resource flows such as water, electricity, light or heat. Our methodology follows a very pragmatic approach, combining the syntactic and semantic principles of well-known modeling means such as hybrid automata, data-flow languages and architecture description languages into a coherent language. The borrowed aspects have been carefully combined and formalised in a well-defined operational semantics. The DSL provides two concrete syntaxes: CREST diagrams, a graphical language that is easily understandable and serves as a model basis, and crestdsl, an internal DSL implementation that supports rapid prototyping—both are geared towards usability and clarity. We present the DSL’s semantics, which thoroughly connect the various language concerns into an executable formalism that enables sound simulation and formal verification in crestdsl, and discuss the lessons learned throughout the project.
The study of concurrent and parallel systems has been a challenging research domain within cyberphysical systems community. This chapter provides a pragmatic introduction to the creation and analysis of such system models using the popular Petri nets formalism. Petri nets is a formalism that convinces through its simplicity and applicability.We offer an overview of the most important Petri nets concepts, analysis techniques and model checking approaches. Finally, we show the use of so-called High-level Petri nets for the representation of complex data structures and functionality and present a novel research approach that allows the use of Petri nets inside Functional Mock-up Units and cyber-physical system models.
A new trend in programming languages is to merge multiple paradigms, rather than focusing on one as it was customary in the past. Most modern languages provide native support for imperative and functional programming, object-orientation and even concurrency. The typical mechanism used to blend heterogeneous language concepts is to rely on functions. Functions are a very well understood, usually offer an excellent abstraction over diverging models of computation, but are unsuitable to interface logic programming, unfortunately. Embedding a full logic programming language into a host is also unsatisfactory, as it impedes the ability to make data flow from one paradigm to the other. As an answer to these issues, we propose LogicKit, a library that aims to bridge the gap between logic programming and other traditional paradigms. LogicKit is a Prolog-inspired language that blends seamlessly into Swift. Predicates are first-class objects in the host language and data can flow in and out of a logic program, without the need for any data serialization/parsing. Our framework is distributed in the form of a Swift library that can be imported in any Swift project effortlessly. We elaborate on our motivation for developing LogicKit and present the library by the means of examples.
Real-time system design involves proving the schedulability of a set of tasks with hard timing and other constraints that should run on one or several cores. When those requirements are known at design time, it is possible to compute a fixed scheduling of tasks before deployment. This approach avoids the overhead induced by an online scheduler and allows the designer to verify the schedulability of the taskset design under normal and degraded conditions, such as core failures. In this context, we propose to solve the schedulability problem as a state space exploration problem. We represent the schedulings as partial functions that map each task to a core and a point in time. Partial functions can be efficiently encoded using a new variant of decision diagrams, called Map-Family Decision Diagrams (MFDDs). Our setting allows first to create the MFDD of all possible schedulings and then apply homomorphic operations directly on it, in order to obtain the schedulings that respect the constraints of the taskset.
Swift is a modern general-purpose programming language, designed to be a replacement for C-based languages. Although primarily directed at development of applications for Apple's operating systems, Swift's adoption has been growing steadily in other domains, ranging from server-side services to machine learning. This success can be partly attributed to a rich type system that enables the design of safe, fast, and expressive programming interfaces. Unfortunately, this richness comes at the cost of complexity, setting a high entry barrier to exploit Swift's full potential. Furthermore, existing documentation typically only relies on examples, leaving new users with little help to build a deeper understanding of the underlying rules and mechanisms. This paper aims to tackle this issue by laying out the foundations for a formal framework to reason about Swift's type system. We introduce Featherweight Swift, a minimal language stripped of all features not essential to describe its typing rules. Featherweight Swift features classes and protocol inheritance, supports retroactive modeling, and emulates Swift's overriding mechanisms. Yet its formalization fits on a few pages. We present Featherweight Swift's syntax and semantics. We then elaborate on the usability of our framework to reason about Swift's features, future extensions, and implementation by discussing a bug in Swift's compiler, discovered throughout the design of our calculus.
Anzen is a multi-paradigm programming language that aims to provide explicit and controllable assignment semantics. It is based on the observation that abstractions over memory management and data representation, as commonly adopted by contemporary programming languages, often transpire relics of the underlying memory model and lead to confusing assignment semantics in the presence of aliases. In response, Anzen’s goal is to offer a modern approach to programming, built on a sound and unambiguous semantics.This paper describes the implementation of a compiler for Anzen. Our implementation transpiles sources to an intermediate language inspired by the LLVM IR, designed to ease further analysis on Anzen’s statements. This intermediate representation is then consumed by a register-based virtual machine. We present the Anzen compiler’s architecture, introduce its intermediate language and describe the latter’s evaluation. Our work aims to set a reference implementation for future developments and extensions of the language.
Despite the plethora of powerful software to spot bugs, identify performance bottlenecks or simply improve the overall quality of code, programming languages remain the first and most important tool of a developer. Therefore, appropriate abstractions, unambiguous syntaxes and intuitive semantics are paramount to convey intent concisely and efficiently. The continuing growth in computing power has allowed modern compilers and runtime system to handle once thought unrealistic features, such as type inference and reflection, making code simpler to write and clearer to read. Unfortunately, relics of the underlying memory model still transpire in most programming languages, leading to confusing assignment semantics. This paper introduces Anzen, a programming language that aims to make assignments easier to understand and manipulate. The language offers three assignment operators, with unequivocal semantics, that can reproduce all common imperative assignment strategies. It is accompanied by a type system based on type capabilities to enforce uniqueness and immutability. We present Anzen's features informally and formalize it by the means of a minimal calculus.
Representing and reasoning on contexts is an open problem in the semantic web. Despite the fact that context representation has for a long time been treated locally by semantic web practitioners, a recognized and widely accepted consensus regarding the way of encoding and particularly reasoning on contextual knowledge has not yet been reached by far. In this paper, we present OWLc : a contextual two-dimensional web ontology language. Using the first dimension, we can reason on contexts-dependent classes, properties, and axioms and using the second dimension, we can reason on knowledge about contexts which we consider formal objects, as proposed by McCarthy [McCarthy, 1987]. We demonstrate the modeling strength and reasoning capabilities of OWLc with a practical scenario from the digital humanity domain. We chose the Ferdinand de Saussure [Joseph, 2012] use case in virtue of its inherent contextual nature, as well as its notable complexity which allows us to highlight many issues connected with contextual knowledge representation and reasoning.
Representing the context of triples and reasoning on contextualized triples is an open problem in the semantic web. In this paper, we present $$OWL^{C}$$ : a contextual two-dimensional web ontology language. Using the first dimension, we can define contexts-dependent classes, properties, and axioms and using the second dimension, we can express knowledge about contexts which we consider formal objects, as proposed by McCarthy [17]. Moreover, we describe a contextual extension of the OWL entailment rules, and we present a new set of rules for reasoning on contexts. We demonstrate the modeling strength and reasoning capabilities of $$OWL^{C}$$ with a practical scenario from the digital humanity domain. We chose the FDS project in virtue of its inherent contextual nature, as well as its notable complexity which allow us to highlight many issues connected with contextual knowledge representation and reasoning.
Models of small CPS and IoT applications often use approximated values that describe physical system behaviour. Physical resources, such as electricity consumption and heating power, have to be estimated, since many off-the-shelf components lack the required descriptions. Controllers which are based on these approximations can hence use imprecise models, perform misleading simulation, and cause damaged systems and financial loss. In this paper we present ML4CREST, a machine learning approach to automatically calibrate models using sensor measurements. We show that our approach is well-suited for the calibration of the flow rates within an automated watering system, which allows precise simulation and prevents spillage.
This article presents CREST, a novel domain-specific language for the modelling of cyber-physical systems. CREST is designed for the simple and clear modelling, simulation and verification of small-scale systems such as home and office automation, smart gardening systems and similar. The language is designed to model the flow of resources throughout the system. It features synchronous system evolution and reactive behaviour. CREST’s formal semantics allow real-valued time advances and the modelling of timed system evolution. The continuous time concept permits the precise simulation of future system behaviour by automatically calculating next transition times. We present CREST in a practical manner, and elaborate on the Python-based DSL implementation and simulator.
This paper introduces mcc4mcc, the Model Checker Collection for the Model Checking Contest, a tool that wraps multiple model checking solutions, and applies the most appropriate one based on the characteristics of the model it is given. It leverages machine learning algorithms to carry out this selection, based on the results gathered from the 2017 edition of the Model Checking Contest, an annual event in which multiple tools compete to verify different properties on a large variety of models. Our approach brings two important contributions. First, our tool offers the opportunity to further investigate on the relation between model characteristics and verification techniques. Second, it lays out the groundwork for a unified way to distribute model checking software using virtual containers.
Aliasing is a vital concept of programming, but it comes with a plethora of challenging issues, such as the problems related to race safety. This has motivated years of research, and promising solutions such as ownership or linear types have found their way into modern programming languages. Unfortunately, most current approaches are restrictive. In particular, they often enforce a single-writer constraint, which prohibits the creation of mutable self-referential structures. While this constraint is often indispensable in the context of preemptive multithreading, it can be worked around in the case of single threaded programs. With the recent resurgence of cooperative multitasking, where processes voluntarily share control over a single execution thread, this appears to be interesting trade-off. In this paper, we propose a type system that relaxes the usual single-writer constraint for single threaded programs, without sacrificing race safety properties. We present it in the form of a simple reference-based language, for which we provide a formal semantics, as well as an interpreter.
Luis Pedro合作论文数University of Geneva12
Niels Lohmann合作论文数MBition GmbH4
Dino Mandrioli合作论文数Dipartimento di Elettronica e Informazione
Politecnico di Milano3