Publications - Publications https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Bcontroller%5D=Publications&cHash=1877818b19e0b5ff2dd510e40ac7faf2 en-us PURE Extension typo3support@science.au.dk (Web Department) 30 <![CDATA[The Nextgen Modality]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=dc832a0d-8339-44bb-907a-b5c490ccce2a&tx_pure_pure5%5BshowType%5D=pub&cHash=762b4c77a177938535957ba8fa1481ce Vindum, S. F., Georges, A. L., Birkedal, L. As separation logic is a logic of resources, the way in which resources can soundly change and be updated is a fundamental aspect. Such changes have typically been restricted to certain local or frame-preserving updates. However, recently we have seen separation logics where the restriction to frame-preserving updates seems to be a hindrance towards achieving the ideal program reasoning rules. In this, paper we propose a novel nextgen modality that enables reasoning across generations where each generational change can update resources in ways that are non-local and non-frame-preserving. We implement the idea as an extension to the Iris base logic, which enriches Iris with an entirely new capability: the ability to make non-frame-preserving updates to ghost state. We show that two existing Iris modalities are special cases of the nextgen modality. Our “extension” can thus also be seen as a generalization and simplification of the Iris base logic. To demonstrate the utility of the nextgen modality we use it to construct a separation logic for a programming language with explicit stack allocation and with a return operation that clears entire stack frames. The nextgen modality is used to great effect in the reasoning rule for return, where a modular and practical reasoning rule is otherwise out of reach. This is the first separation logic for a high-level programming language with stack allocation. We sketch ideas for future work in other domains where we think the nextgen modality can be useful.

]]>
Forskning Wed, 01 Jan 2025 02:21:39 +0100 dc832a0d-8339-44bb-907a-b5c490ccce2a
<![CDATA[Approximate Relational Reasoning for Higher-Order Probabilistic Programs]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=ffc8d36f-5a5e-4a18-8fa8-95dca7239217&tx_pure_pure5%5BshowType%5D=pub&cHash=cda27bea7da43ff14858aee1f8befaa8 Haselwarter, P. G., Li, K. H., Aguirre, A., Gregersen, S. O., Tassarotti, J., Birkedal, L. Properties such as provable security and correctness for randomized programs are naturally expressed relationally as approximate equivalences. As a result, a number of relational program logics have been developed to reason about such approximate equivalences of probabilistic programs. However, existing approximate relational logics are mostly restricted to first-order programs without general state. In this paper we develop Approxis, a higher-order approximate relational separation logic for reasoning about approximate equivalence of programs written in an expressive ML-like language with discrete probabilistic sampling, higher-order functions, and higher-order state. The Approxis logic recasts the concept of error credits in the relational setting to reason about relational approximation, which allows for expressive notions of modularity and composition, a range of new approximate relational rules, and an internalization of a standard limiting argument for showing exact probabilistic equivalences by approximation. We also use Approxis to develop a logical relation model that quantifies over error credits, which can be used to prove exact contextual equivalence. We demonstrate the flexibility of our approach on a range of examples, including the PRP/PRF switching lemma, IND$-CPA security of an encryption scheme, and a collection of rejection samplers. All of the results have been mechanized in the Coq proof assistant and the Iris separation logic framework.

]]>
Forskning Tue, 07 Jan 2025 02:21:39 +0100 ffc8d36f-5a5e-4a18-8fa8-95dca7239217
<![CDATA[A Modal Deconstruction of Löb Induction]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=26729ed2-b34a-48e0-a0dd-0d716aeed74b&tx_pure_pure5%5BshowType%5D=pub&cHash=9aaf60c57437d640b293014067e4325e Gratzer, D. We present a novel analysis of the fundamental Löb induction principle from guarded recursion. Taking advantage of recent work in modal type theory and univalent foundations, we derive Löb induction from a simpler and more conceptual set of primitives. We then capitalize on these insights to present Gatsby, the first guarded type theory capturing the rich modal structure of the topos of trees alongside Löb induction without immediately precluding canonicity or normalization. We show that Gatsby can recover many prior approaches to guarded recursion and use its additional power to improve on prior examples. We crucially rely on homotopical insights and Gatsby constitutes a new application of univalent foundations to the theory of programming languages.

]]>
Forskning Tue, 07 Jan 2025 02:21:39 +0100 26729ed2-b34a-48e0-a0dd-0d716aeed74b
<![CDATA[Modelling Recursion and Probabilistic Choice in Guarded Type Theory]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=d5998eec-e914-4bfa-891b-ff8506bad04a&tx_pure_pure5%5BshowType%5D=pub&cHash=22e03e65db11442d11fd4683edd6c6ff Stassen, P., Møgelberg, R. E., Zwart, M. A., Aguirre, A., Birkedal, L. Constructive type theory combines logic and programming in one language. This is useful both for reasoning about programs written in type theory, as well as for reasoning about other programming languages inside type theory. It is well-known that it is challenging to extend these applications to languages with recursion and computational effects such as probabilistic choice, because these features are not easily represented in constructive type theory. We show how to define and reason about FPC⊕, a programming language with probabilistic choice and recursive types, in guarded type theory. We use higher inductive types to represent finite distributions and guarded recursion to model recursion. We define both operational and denotational semantics of FPC⊕, as well as a relation between the two. The relation can be used to prove adequacy, but we also show how to use it to reason about programs up to contextual equivalence.

]]>
Forskning Thu, 09 Jan 2025 02:21:39 +0100 d5998eec-e914-4bfa-891b-ff8506bad04a
<![CDATA[CertiCoq-Wasm]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=2aadea2a-9636-439e-aacf-7713c61995e7&tx_pure_pure5%5BshowType%5D=pub&cHash=e1703b8a3fd1069e00685a3744b66336 Meier, W., Jensen, M., Pichon-Pharabod, J., Spitters, B. We contribute CertiCoq-Wasm, a verified WebAssembly backend for CertiCoq. CertiCoq-Wasm is implemented and verified in the Coq proof assistant, and is mechanised with respect to the WasmCert-Coq formalisation of the WebAssembly standard. CertiCoq-Wasm works from CertiCoq’s minimal lambda calculus in administrative normal form (ANF), and produces WebAssembly programs with reasonable performance. It implements Coq’s primitive integer operations as efficient WebAssembly instructions, identifying a corner case in their implementation that led to unsoundness. We compare CertiCoq-Wasm against other, partially verified extraction mechanisms from Coq to WebAssembly, benchmarking running time and program size. We demonstrate the practical usability of CertiCoq-Wasm with two case studies: we extract and run a Gallina program on the web, and a ConCert smart contract on the Concordium blockchain.

]]>
Forskning Fri, 10 Jan 2025 02:21:39 +0100 2aadea2a-9636-439e-aacf-7713c61995e7
<![CDATA[Program Analysis via Multiple Context Free Language Reachability]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=adda34b0-4bfc-45fa-ad7a-7b7f0f228ae4&tx_pure_pure5%5BshowType%5D=pub&cHash=d2c2b75ab93347015810f750e228a828 Conrado, G. K., Kjelstrøm, A. H., Van De Pol, J., Pavlogiannis, A. Context-free language (CFL) reachability is a standard approach in static analyses, where the analysis question (e.g., is there a dataflow from x to y?) is phrased as a language reachability problem on a graph G wrt a CFL L. However, CFLs lack the expressiveness needed for high analysis precision. On the other hand, common formalisms for context-sensitive languages are too expressive, in the sense that the corresponding reachability problem becomes undecidable. Are there useful context-sensitive language-reachability models for static analysis? In this paper, we introduce Multiple Context-Free Language (MCFL) reachability as an expressive yet tractable model for static program analysis. MCFLs form an infinite hierarchy of mildly context sensitive languages parameterized by a dimension d and a rank r. Larger d and r yield progressively more expressive MCFLs, offering tunable analysis precision. We showcase the utility of MCFL reachability by developing a family of MCFLs that approximate interleaved Dyck reachability, a common but undecidable static analysis problem. Given the increased expressiveness of MCFLs, one natural question pertains to their algorithmic complexity, i.e., how fast can MCFL reachability be computed? We show that the problem takes O(n2d+1) time on a graph of n nodes when r=1, and O(nd(r+1)) time when r>1. Moreover, we show that when r=1, even the simpler membership problem has a lower bound of n2d based on the Strong Exponential Time Hypothesis, while reachability for d=1 has a lower bound of n3 based on the combinatorial Boolean Matrix Multiplication Hypothesis. Thus, for r=1, our algorithm is optimal within a factor n for all levels of the hierarchy based on the dimension d (and fully optimal for d=1). We implement our MCFL reachability algorithm and evaluate it by underapproximating interleaved Dyck reachability for a standard taint analysis for Android. When combined with existing overapproximate methods, MCFL reachability discovers all tainted information on 8 out of 11 benchmarks, while it has remarkable coverage (confirming 94.3% of the reachable pairs reported by the overapproximation) on the remaining 3. To our knowledge, this is the first report of high and provable coverage for this challenging benchmark set.

]]>
Forskning Wed, 01 Jan 2025 02:21:39 +0100 adda34b0-4bfc-45fa-ad7a-7b7f0f228ae4
<![CDATA[Optimal Layout-Aware CNOT Circuit Synthesis with Qubit Permutation]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=c4d9661c-9a79-410d-b3d4-63c06d061cd0&tx_pure_pure5%5BshowType%5D=pub&cHash=07b3f41c9416e1fa41d373c08d13fa8d Shaik, I., Pol, J. v. d. Forskning Wed, 16 Oct 2024 02:21:39 +0200 c4d9661c-9a79-410d-b3d4-63c06d061cd0 <![CDATA[Operations on Fixpoint Equation Systems]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=883c7899-ff12-4ce7-865a-4ac11e65bc2f&tx_pure_pure5%5BshowType%5D=pub&cHash=d6c71bde9f6842e9b826096b3a9800ce Neele, T., Pol, J. v. d. Forskning Wed, 10 Jul 2024 02:21:39 +0200 883c7899-ff12-4ce7-865a-4ac11e65bc2f <![CDATA[Random Access on Narrow Decision Diagrams in External Memory]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=0c7ddf43-fbd3-45a6-b333-67f71648f4f1&tx_pure_pure5%5BshowType%5D=pub&cHash=2994f3c1343b0a98215aa09a4b057ddc Sølvsten, S., Rysgaard, C. M., van de Pol, J. The external memory BDD package Adiar can manipulate Binary Decision Diagrams (BDDs) larger than the RAM of the machine. To do so, it uses one or more priority queues to defer processing each recursion until the relevant nodes are encountered in a sequential scan. We outline how to improve the performance of Adiar’s algorithms if the BDD width of one of its inputs is small enough to fit into main memory. In this case, one of the algorithms’ priority queues can entirely be replaced with (levelised) random access to the nodes of the narrow BDD. This preserves the I/O efficiency of the original algorithm, is applicable to other types of decision diagrams, and significantly improves performance for many larger BDD computations.

]]>
Forskning Wed, 01 Jan 2025 02:21:39 +0100 0c7ddf43-fbd3-45a6-b333-67f71648f4f1
<![CDATA[A Logical Approach to Type Soundness]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=6c1d3054-690e-429f-8d9e-527c436f14b6&tx_pure_pure5%5BshowType%5D=pub&cHash=39c0762a6ffbc3952ed8264debcb1001 Timany, A., Krebbers, R., Dreyer, D., Birkedal, L. Type soundness, which asserts that “well-typed programs cannot go wrong,” is widely viewed as the canonical theorem one must prove to establish that a type system is doing its job. It is commonly proved using the so-called syntactic approach (also known as progress and preservation), which has had a huge impact on the study and teaching of programming language foundations. Unfortunately, syntactic type soundness is a rather weak theorem. It only applies to programs that are well typed in their entirety and thus tells us nothing about the many programs written in “safe” languages that make use of “unsafe” language features. Even worse, it tells us nothing about whether type systems achieve one of their main goals: enforcement of data abstraction. One can easily define a language that enjoys syntactic type soundness and yet fails to support even the most basic modular reasoning principles for abstraction mechanisms like closures, objects, and abstract data types. Given these concerns, we argue that programming languages researchers should no longer be satisfied with proving syntactic type soundness and should instead start proving semantic type soundness, a more useful theorem that captures more accurately what type systems are actually good for. Semantic type soundness is an old idea-Milner's original account of type soundness from 1978 was semantic-but it fell out of favor in the 1990s due to limitations and complexities of denotational models. In the succeeding decades, thanks to a series of technical advances-notably, step-indexed Kripke logical relations constructed over operational semantics and higher-order concurrent separation logic as consolidated in the Iris framework in Coq-we can now build (machine-checked) semantic soundness proofs at a much higher level of abstraction than was previously possible. The resulting “logical” approach to semantic type soundness has already been employed to great effect in a number of recent papers, but those papers typically (a) concern advanced problem scenarios that complicate the presentation, (b) assume significant prior knowledge of the reader, and (c) suppress many details of the proofs. Here, we aim to provide a gentler, more pedagogically motivated introduction to logical type soundness, targeted at a broader audience that may or may not be familiar with logical relations and Iris. As a bonus, we also show how logical type soundness proofs can easily be generalized to establish an even stronger relational property-representation independence-for realistic type systems.

]]>
Forskning Fri, 01 Nov 2024 02:21:39 +0100 6c1d3054-690e-429f-8d9e-527c436f14b6
<![CDATA[Modernizing FIPS for safe languages and verified libraries]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=0264b755-41a8-4c17-a50c-4901cd8e6848&tx_pure_pure5%5BshowType%5D=pub&cHash=2fc90d812e7cce88fbddd7e325a15cae Protzenko, J., Spitters, B. Forskning Mon, 01 Jan 2024 02:21:39 +0100 0264b755-41a8-4c17-a50c-4901cd8e6848 <![CDATA[Metadata Privacy Beyond Tunneling for Instant Messaging]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=5a1d674b-5e7a-43b6-a4d4-8ce6aef7786f&tx_pure_pure5%5BshowType%5D=pub&cHash=7b53be26da804aebe92903ead3515e6c Nelson, B., Pagnin, E., Askarov, A. Transport layer data leaks metadata unintentionally - such as who communicates with whom. While tools for strong transport layer privacy exist, they have adoption obstacles, including performance overheads incompatible with mobile devices. We posit that by changing the objective of metadata privacy for all traffic, we can open up a new design space for pragmatic approaches to transport layer privacy. As a first step in this direction, we propose using techniques from information flow control and present a principled approach to constructing formal models of systems with metadata privacy for some, deniable, traffic. We prove that deniable traffic achieves metadata privacy against strong adversaries- this constitutes the first bridging of information flow control and anonymous communication to our knowledge. Additionally, we show that existing state-of-the-art protocols can be extended to support metadata privacy, by designing a novel protocol for deniable instant messaging (DenIM), which is a variant of the Signal protocol. To show the efficacy of our approach, we implement and evaluate a proof-of-concept instant messaging system running DenIM on top of unmodified Signal. We empirically show that the DenIM on Signal can maintain low-latency for unmodified Signal traffic without breaking existing features, while at the same time supporting deniable Signal traffic.

]]>
Forskning Mon, 01 Jan 2024 02:21:39 +0100 5a1d674b-5e7a-43b6-a4d4-8ce6aef7786f
<![CDATA[Tachis]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=3cda3dca-266d-496f-8def-1a723ab05d32&tx_pure_pure5%5BshowType%5D=pub&cHash=cbb495d48f41451f08ce9f0931890655 Haselwarter, P. G., Li, K. H.E.I., Medeiros, M. D.E., et al. We present Tachis, a higher-order separation logic to reason about the expected cost of probabilistic programs. Inspired by the uses of time credits for reasoning about the running time of deterministic programs, we introduce a novel notion of probabilistic cost credit. Probabilistic cost credits are a separation logic resource that can be used to pay for the cost of operations in programs, and that can be distributed across all possible branches of sampling instructions according to their weight, thus enabling us to reason about expected cost. The representation of cost credits as separation logic resources gives Tachis a great deal of flexibility and expressivity. In particular, it permits reasoning about amortized expected cost by storing excess credits as potential into data structures to pay for future operations. Tachis further supports a range of cost models, including running time and entropy usage. We showcase the versatility of this approach by applying our techniques to prove upper bounds on the expected cost of a variety of probabilistic algorithms and data structures, including randomized quicksort, hash tables, and meldable heaps. All of our results have been mechanized using Coq, Iris, and the Coquelicot real analysis library.

]]>
Forskning Tue, 08 Oct 2024 02:21:39 +0200 3cda3dca-266d-496f-8def-1a723ab05d32
<![CDATA[Iris-MSWasm]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=fe9dc2f8-2959-4f36-a8ef-74577da9633f&tx_pure_pure5%5BshowType%5D=pub&cHash=2ea104632eefd3e6b55940b46520b744 Legoupil, M., Rousseau, J., Georges, A. L., Pichon-Pharabod, J., Birkedal, L. WebAssembly offers coarse-grained encapsulation guarantees via its module system, but does not support fine-grained sharing of its linear memory. MSWasm is a recent proposal which extends WebAssembly with fine-grained memory sharing via handles, a type of capability that guarantees spatial and temporal safety, and thus enables an expressive yet safe style of programming with flexible sharing. In this paper, we formally validate the pen-and-paper design of MSWasm. To do so, we first define MSWasmCert, a mechanisation of MSWasm that makes it a fully-defined, conservative extension of WebAssembly 1.0, including the module system. We then develop Iris-MSWasm, a foundational reasoning framework for MSWasm composed of a separation logic to reason about known code, and a logical relation to reason about unknown, potentially adversarial code. Iris-MSWasm thereby makes explicit a key aspect of the implicit universal contract of MSWasm: robust capability safety. We apply Iris-MSWasm to reason about key use cases of handles, in which the effect of calling an unknown function is bounded by robust capability safety. Iris-MSWasm thus works as a framework to prove complex security properties of MSWasm programs, and provides a foundation to evaluate the language-level guarantees of MSWasm.

]]>
Forskning Tue, 01 Oct 2024 02:21:39 +0200 fe9dc2f8-2959-4f36-a8ef-74577da9633f
<![CDATA[Optimal Layout Synthesis for Deep Quantum Circuits on NISQ Processors with 100+ Qubits]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=52b2eadf-3b8a-4b4a-8a3c-987a81b13998&tx_pure_pure5%5BshowType%5D=pub&cHash=606b77f504347e4156e1a9ed9596cbfa Shaik, I., Van de Pol, J. Layout synthesis is mapping a quantum circuit to a quantum processor. SWAP gate insertions are needed for scheduling 2-qubit gates only on connected physical qubits. With the ever-increasing number of qubits in NISQ processors, scalable layout synthesis is of utmost importance. With large optimality gaps observed in heuristic approaches, scalable exact methods are needed. While recent exact and near-optimal approaches scale to moderate circuits, large deep circuits are still out of scope. In this work, we propose a SAT encoding based on parallel plans that apply 1 SWAP and a group of CNOTs at each time step. Using domain-specific information, we maintain optimality in parallel plans while scaling to large and deep circuits. From our results, we show the scalability of our approach which significantly outperforms leading exact and near-optimal approaches (up to 100x). For the first time, we can optimally map several 8, 14, and 16 qubit circuits onto 54, 80, and 127 qubit platforms with up to 17 SWAPs. While adding optimal SWAPs, we also report near-optimal depth in our mapped circuits.

]]>
Forskning Thu, 01 Aug 2024 02:21:39 +0200 52b2eadf-3b8a-4b4a-8a3c-987a81b13998
<![CDATA[Almost-Sure Termination by Guarded Refinement]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=c1eb4e5c-9559-44b4-8f0b-e10381bd2079&tx_pure_pure5%5BshowType%5D=pub&cHash=a387e9f1d303bb9b376ed21437a99883 Gregersen, S. O., Aguirre, A., Haselwarter, P. G., Tassarotti, J., Birkedal, L. Almost-sure termination is an important correctness property for probabilistic programs, and a number of program logics have been developed for establishing it. However, these logics have mostly been developed for first-order programs written in languages with specific syntactic patterns for looping. In this paper, we consider almost-sure termination for higher-order probabilistic programs with general references. This combination of features allows for recursion and looping to be encoded through a variety of patterns. Therefore, rather than developing proof rules for reasoning about particular recursion patterns, we instead propose an approach based on proving refinement between a higher-order program and a simpler probabilistic model, in such a way that the refinement preserves termination behavior. By proving a refinement, almost-sure termination behavior of the program can then be established by analyzing the simpler model. We present this approach in the form of Caliper, a higher-order separation logic for proving termination-preserving refinements. Caliper uses probabilistic couplings to carry out relational reasoning between a program and a model. To handle the range of recursion patterns found in higher-order programs, Caliper uses guarded recursion, in particular the principle of Löb induction. A technical novelty is that Caliper does not require the use of transfinite step indexing or other technical restrictions found in prior work on guarded recursion for termination-preservation refinement. We demonstrate the flexibility of this approach by proving almost-sure termination of several examples, including first-order loop constructs, a random list generator, treaps, and a sampler for Galton-Watson trees that uses higher-order store. All the results have been mechanized in the Coq proof assistant.

]]>
Forskning Thu, 01 Aug 2024 02:21:39 +0200 c1eb4e5c-9559-44b4-8f0b-e10381bd2079
<![CDATA[Error Credits]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=238b362d-5e39-4781-981f-4a19301207e1&tx_pure_pure5%5BshowType%5D=pub&cHash=1b7b9853903efc0e9f8e907263402fa5 Aguirre, A., Haselwarter, P. G., De Medeiros, M., et al. Probabilistic programs often trade accuracy for efficiency, and thus may, with a small probability, return an incorrect result. It is important to obtain precise bounds for the probability of these errors, but existing verification approaches have limitations that lead to error probability bounds that are excessively coarse, or only apply to first-order programs. In this paper we present Eris, a higher-order separation logic for proving error probability bounds for probabilistic programs written in an expressive higher-order language. Our key novelty is the introduction of error credits, a separation logic resource that tracks an upper bound on the probability that a program returns an erroneous result. By representing error bounds as a resource, we recover the benefits of separation logic, including compositionality, modularity, and dependency between errors and program terms, allowing for more precise specifications. Moreover, we enable novel reasoning principles such as expectation-preserving error composition, amortized error reasoning, and error induction. We illustrate the advantages of our approach by proving amortized error bounds on a range of examples, including collision probabilities in hash functions, which allow us to write more modular specifications for data structures that use them as clients. We also use our logic to prove correctness and almost-sure termination of rejection sampling algorithms. All of our results have been mechanized in the Coq proof assistant using the Iris separation logic framework and the Coquelicot real analysis library.

]]>
Forskning Thu, 01 Aug 2024 02:21:39 +0200 238b362d-5e39-4781-981f-4a19301207e1
<![CDATA[Fast Symbolic Computation of Bottom SCCs]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=0890f501-6e40-45e8-9591-fefebb380279&tx_pure_pure5%5BshowType%5D=pub&cHash=2624a7aee8e5a99dc0c6e3ac35d10f83 Jakobsen, A. B., Jørgensen, R. S. M., van de Pol, J., Pavlogiannis, A. The computation of bottom strongly connected components (BSCCs) is a fundamental task in model checking, as well as in characterizing the attractors of dynamical systems. As such, symbolic algorithms for BSCCs have received special attention, and are based on the idea that the computation of an SCC can be stopped early, as soon as it is deemed to be non-bottom. In this paper we introduce PENDANT, a new symbolic algorithm for computing BSCCs which runs in linear symbolic time. In contrast to the standard approach of escaping non-bottom SCCs, PENDANT aims to start the computation from nodes that are likely to belong to BSCCs, and thus is more effective in sidestepping SCCs that are non-bottom. Moreover, we employ a simple yet powerful deadlock-detection technique, that quickly identifies singleton BSCCs before the main algorithm is run. Our experimental evaluation on three diverse datasets of 553 models demonstrates the efficacy of our two methods: PENDANT is decisively faster than the standard existing algorithm for BSCC computation, while deadlock detection improves the performance of each algorithm significantly.

]]>
Forskning Mon, 01 Jan 2024 02:21:39 +0100 0890f501-6e40-45e8-9591-fefebb380279
<![CDATA[On-The-Fly Algorithm for Reachability in Parametric Timed Games]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=6b9cb60f-9654-4d2f-a6a6-df30175bed6b&tx_pure_pure5%5BshowType%5D=pub&cHash=34cb1f587ef551328788677332d69463 Dahlsen-Jensen, M. B., Fievet, B., Petrucci, L., de Pol, J. v. Parametric Timed Games (PTG) are an extension of the model of Timed Automata. They allow for the verification and synthesis of real-time systems, reactive to their environment and depending on adjustable parameters. Given a PTG and a reachability objective, we synthesize the values of the parameters such that the game is winning for the controller. We adapt and implement the On-The-Fly algorithm for parameter synthesis for PTG. Several pruning heuristics are introduced, to improve termination and speed of the algorithm. We evaluate the feasibility of parameter synthesis for PTG on two large case studies. Finally, we investigate the correctness guarantee of the algorithm: though the problem is undecidable, our semi-algorithm produces all correct parameter valuations “in the limit”.

]]>
Forskning Mon, 01 Jan 2024 02:21:39 +0100 6b9cb60f-9654-4d2f-a6a6-df30175bed6b
<![CDATA[An Axiomatic Basis for Computer Programming on the Relaxed Arm-A Architecture]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=9b5a8bf2-a445-4382-9ab9-c62a84406c8d&tx_pure_pure5%5BshowType%5D=pub&cHash=6fc09f537d3e6f04eacdcc19922289ed Hammond, A., Liu, Z., Pérami, T., Sewell, P., Birkedal, L., Pichon-Pharabod, J. Very relaxed concurrency memory models, like those of the Arm-A, RISC-V, and IBM Power hardware architectures, underpin much of computing but break a fundamental intuition about programs, namely that syntactic program order and the reads-from relation always both induce order in the execution. Instead, out-of-order execution is allowed except where prevented by certain pairwise dependencies, barriers, or other synchronisation. This means that there is no notion of the 'current' state of the program, making it challenging to design (and prove sound) syntax-directed, modular reasoning methods like Hoare logics, as usable resources cannot implicitly flow from one program point to the next. We present AxSL, a separation logic for the relaxed memory model of Arm-A, that captures the fine-grained reasoning underpinning the low-overhead synchronisation mechanisms used by high-performance systems code. In particular, AxSL allows transferring arbitrary resources using relaxed reads and writes when they induce inter-thread ordering. We mechanise AxSL in the Iris separation logic framework, illustrate it on key examples, and prove it sound with respect to the axiomatic memory model of Arm-A. Our approach is largely generic in the axiomatic model and in the instruction-set semantics, offering a potential way forward for compositional reasoning for other similar models, and for the combination of production concurrency models and full-scale ISAs.

]]>
Forskning Fri, 05 Jan 2024 02:21:39 +0100 9b5a8bf2-a445-4382-9ab9-c62a84406c8d
<![CDATA[Towards Univalent Reference Types]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=ab64e42b-9435-446c-a1a0-e49081176d00&tx_pure_pure5%5BshowType%5D=pub&cHash=c05a0a58bc945ea51f91b8ccea545eac Sterling, J., Gratzer, D., Birkedal, L. We develop a denotational semantics for general reference types in an impredicative version of guarded homotopy type theory, an adaptation of synthetic guarded domain theory to Voevodsky’s univalent foundations. We observe for the first time the profound impact of univalence on the denotational semantics of mutable state. Univalence automatically ensures that all computations are invariant under symmetries of the heap – a bountiful source of program equivalences. In particular, even the most simplistic univalent model enjoys many new equations that do not hold when the same constructions are carried out in the universes of traditional set-level (extensional) type theory.

]]>
Forskning Thu, 01 Feb 2024 02:21:39 +0100 ab64e42b-9435-446c-a1a0-e49081176d00
<![CDATA[The Essence of Generalized Algebraic Data Types]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=21ce707f-e751-4cab-ab4c-9caa715fd7df&tx_pure_pure5%5BshowType%5D=pub&cHash=6e69467d70dd8096e383ea741830b439 Sieczkowski, F., Stepanenko, S., Sterling, J., Birkedal, L. This paper considers direct encodings of generalized algebraic data types (GADTs) in a minimal suitable lambda-calculus. To this end, we develop an extension of System Fω with recursive types and internalized type equalities with injective constant type constructors. We show how GADTs and associated pattern-matching constructs can be directly expressed in the calculus, thus showing that it may be treated as a highly idealized modern functional programming language. We prove that the internalized type equalities in conjunction with injectivity rules increase the expressive power of the calculus by establishing a non-macro-expressibility result in Fω, and prove the system type-sound via a syntactic argument. Finally, we build two relational models of our calculus: a simple, unary model that illustrates a novel, two-stage interpretation technique, necessary to account for the equational constraints; and a more sophisticated, binary model that relaxes the construction to allow, for the first time, formal reasoning about data-abstraction in a calculus equipped with GADTs.

]]>
Forskning Mon, 01 Jan 2024 02:21:39 +0100 21ce707f-e751-4cab-ab4c-9caa715fd7df
<![CDATA[Asynchronous Probabilistic Couplings in Higher-Order Separation Logic]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=ab25a536-5dd6-42ad-ab4a-20d9eb6cedb2&tx_pure_pure5%5BshowType%5D=pub&cHash=a67544c849d6c60371d340ca4850a003 Gregersen, S. O., Aguirre, A., Haselwarter, P. G., Tassarotti, J., Birkedal, L. Probabilistic couplings are the foundation for many probabilistic relational program logics and arise when relating random sampling statements across two programs. In relational program logics, this manifests as dedicated coupling rules that, e.g., say we may reason as if two sampling statements return the same value. However, this approach fundamentally requires aligning or "synchronizing"the sampling statements of the two programs which is not always possible. In this paper, we develop Clutch, a higher-order probabilistic relational separation logic that addresses this issue by supporting asynchronous probabilistic couplings. We use Clutch to develop a logical step-indexed logical relation to reason about contextual refinement and equivalence of higher-order programs written in a rich language with a probabilistic choice operator, higher-order local state, and impredicative polymorphism. Finally, we demonstrate our approach on a number of case studies. All the results that appear in the paper have been formalized in the Coq proof assistant using the Coquelicot library and the Iris separation logic framework.

]]>
Forskning Mon, 01 Jan 2024 02:21:39 +0100 ab25a536-5dd6-42ad-ab4a-20d9eb6cedb2
<![CDATA[Welcome from the Chairs]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=072a9a55-4ec5-4ffa-a566-df626f98164c&tx_pure_pure5%5BshowType%5D=pub&cHash=2b4029c6d83d3559ab624dcff5ac6243 Pientka, B., Blazy, S., Traytel, D., Timany, A. Forskning Tue, 09 Jan 2024 02:21:39 +0100 072a9a55-4ec5-4ffa-a566-df626f98164c <![CDATA[Trillium]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=906e414b-9f87-4cf5-8de7-8b051a77b3ed&tx_pure_pure5%5BshowType%5D=pub&cHash=6e3bd1d9023948cdbd46ea6fc42d5dc6 Timany, A., Gregersen, S. O., Stefanesco, L., et al. Expressive state-of-the-art separation logics rely on step-indexing to model semantically complex features and to support modular reasoning about imperative higher-order concurrent and distributed programs. Step- indexing comes, however, with an inherent cost: it restricts the adequacy theorem of program logics to a fairly simple class of safety properties. In this paper, we explore if and how intensional refinement is a viable methodology for strengthening higher-order concurrent (and distributed) separation logic to prove non-trivial safety and liveness properties. Specifically, we introduce Trillium, a language-agnostic separation logic framework for showing intensional refinement relations between traces of a program and a model. We instantiate Trillium with a concurrent language and develop Fairis, a concurrent separation logic, that we use to show liveness properties of concurrent programs under fair scheduling assumptions through a fair liveness-preserving refinement of a model. We also instantiate Trillium with a distributed language and obtain an extension of Aneris, a distributed separation logic, which we use to show refinement relations between distributed systems and TLA+ models.

]]>
Forskning Fri, 05 Jan 2024 02:21:39 +0100 906e414b-9f87-4cf5-8de7-8b051a77b3ed
<![CDATA[Modular Denotational Semantics for Effects with Guarded Interaction Trees]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=d4757dfc-2384-4f38-9607-e3cee00d4c3a&tx_pure_pure5%5BshowType%5D=pub&cHash=4ad5f221fe0ff53af7e3eb4aacd7c94f Frumin, D., Timany, A., Birkedal, L. We present guarded interaction trees - a structure and a fully formalized framework for representing higher-order computations with higher-order effects in Coq, inspired by domain theory and the recently proposed interaction trees. We also present an accompanying separation logic for reasoning about guarded interaction trees. To demonstrate that guarded interaction trees provide a convenient domain for interpreting higher-order languages with effects, we define an interpretation of a PCF-like language with effects and show that this interpretation is sound and computationally adequate; we prove the latter using a logical relation defined using the separation logic. Guarded interaction trees also allow us to combine different effects and reason about them modularly. To illustrate this point, we give a modular proof of type soundness of cross-language interactions for safe interoperability of different higher-order languages with different effects. All results in the paper are formalized in Coq using the Iris logic over guarded type theory.

]]>
Forskning Mon, 01 Jan 2024 02:21:39 +0100 d4757dfc-2384-4f38-9607-e3cee00d4c3a
<![CDATA[The Logical Essence of Well-Bracketed Control Flow]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=b15cdfb1-17d6-4a96-b436-99474400bfe2&tx_pure_pure5%5BshowType%5D=pub&cHash=966db8d6e0c884d7da955049e737cae8 Timany, A., Guéneau, A., Birkedal, L. A program is said to be well-bracketed if every called function must return before its caller can resume execution. This is often the case. Well-bracketedness has been captured semantically as a condition on strategies in fully abstract games models and multiple prior works have studied well-bracketedness by showing correctness/security properties of programs where such properties depend on the well-bracketed nature of control flow. The latter category of prior works have all used involved relational models with explicit state-transition systems capturing the relevant parts of the control flow of the program. In this paper we present the first Hoare-style program logic based on separation logic for reasoning about well-bracketedness and use it to show correctness of well-bracketed programs both directly and also through defining unary and binary logical relations models based on this program logic. All results presented in this paper are formalized on top of the Iris framework and mechanized in the Coq proof assistant.

]]>
Forskning Mon, 01 Jan 2024 02:21:39 +0100 b15cdfb1-17d6-4a96-b436-99474400bfe2
<![CDATA[Modular Verification of State-Based CRDTs in Separation Logic]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=3b22a847-8da5-4adb-b1f0-7861dfca693b&tx_pure_pure5%5BshowType%5D=pub&cHash=7b2a6ad0e17a771a4d99ca10b949efef Nieto, A., Daby-Seesaram, A., Gondelman, L., Timany, A., Birkedal, L. Conflict-free Replicated Datatypes (CRDTs) are a class of distributed data structures that are highly-available and weakly consistent. The CRDT taxonomy is further divided into two subclasses: state-based and operation-based (op-based). Recent prior work showed how to use separation logic to verify convergence and functional correctness of op-based CRDTs while (a) verifying implementations (as opposed to high-level protocols), (b) giving high level specifications that abstract from low-level implementation details, and (c) providing specifications that are modular (i.e. allow client code to use the CRDT like an abstract data type). We extend this separation logic approach to verification of CRDTs to handle state-based CRDTs, while respecting the desiderata (a)–(c). The key idea is to track the state of a CRDT as a function of the set of operations that produced that state. Using the observation that state-based CRDTs are automatically causally-consistent, we obtain CRDT specifications that are agnostic to whether a CRDT is state- or op-based. When taken together with prior work, our technique thus provides a unified approach to specification and verification of op- and state-based CRDTs. We have tested our approach by verifying StateLib, a library for building state-based CRDTs. Using StateLib, we have further verified convergence and functional correctness of multiple example CRDTs from the literature. Our proofs are written in the Aneris distributed separation logic and are mechanized in Coq.

]]>
Forskning Sat, 01 Jul 2023 02:21:39 +0200 3b22a847-8da5-4adb-b1f0-7861dfca693b
<![CDATA[The Last Yard]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=0fb06fd2-dd48-4f64-bd78-b6150b9987ff&tx_pure_pure5%5BshowType%5D=pub&cHash=99d24f0755144d32dfb12ae18d514670 Haselwarter, P. G., Hvass, B. S., Hansen, L. L., Winterhalter, T., Hriţcu, C., Spitters, B. The field of high-assurance cryptography is quickly maturing, yet a unified foundational framework for end-to-end formal verification of efficient cryptographic implementations is still missing. To address this gap, we use the Coq proof assistant to formally connect three existing tools: (1) the Hacspec emergent cryptographic specification language; (2) the Jasmin language for efficient, high-assurance cryptographic implementations; and (3) the SSProve foundational verification framework for modular cryptographic proofs. We first connect Hacspec with SSProve by devising a new translation from Hacspec specifications to imperative SSProve code. We validate this translation by considering a second, more standard translation from Hacspec to purely functional Coq code and generate a proof of the equivalence between the code produced by the two translations. We further define a translation from Jasmin to SSProve, which allows us to formally reason in SSProve about efficient cryptographic implementations in Jasmin. We prove this translation correct in Coq with respect to Jasmin's operational semantics. Finally, we demonstrate the usefulness of our approach by giving a foundational end-to-end Coq proof of an efficient AES implementation. For this case study, we start from an existing Jasmin implementation of AES that makes use of hardware acceleration and prove that it conforms to a specification of the AES standard written in Hacspec. We use SSProve to formalize the security of the encryption scheme based on the Jasmin implementation of AES.

]]>
Forskning Mon, 01 Jan 2024 02:21:39 +0100 0fb06fd2-dd48-4f64-bd78-b6150b9987ff
<![CDATA[A manifesto for applicable formal methods]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=81351c36-fde0-44a9-886f-7fa55711edfd&tx_pure_pure5%5BshowType%5D=pub&cHash=69dfe3c75d59c2f7c32335a867d7a918 Gleirscher, M., van de Pol, J., Woodcock, J. Recently, formal methods have been used in large industrial organisations (including AWS, Facebook/Meta, and Microsoft) and have proved to be an effective part of a software engineering process finding important bugs. Perhaps because of that, practitioners are interested in using them more often. Nevertheless, formal methods are far less applied than expected, particularly for safety-critical systems where they are strongly recommended and have the most significant potential. We hypothesise that formal methods still seem not applicable enough or ready for their intended use in such areas. In critical software engineering, what do we mean when we speak of a formal method? And what does it mean for such a method to be applicable both from a scientific and practical viewpoint? Based on what the literature tells about the first question, with this manifesto, we identify key challenges and lay out a set of guiding principles that, when followed by a formal method, give rise to its mature applicability in a given scope. Rather than exercising criticism of past developments, this manifesto strives to foster increased use of formal methods in any appropriate context to the maximum benefit.

]]>
Forskning Fri, 01 Dec 2023 02:21:39 +0100 81351c36-fde0-44a9-886f-7fa55711edfd
<![CDATA[Cerise]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=0b91fce5-ff15-48be-b077-83035db76d32&tx_pure_pure5%5BshowType%5D=pub&cHash=2434d97cac75b06817a434cf12d20dc9 Georges, A. L., Guéneau, A., Van Strydonck, T., et al. Forskning Mon, 12 Feb 2024 02:21:39 +0100 0b91fce5-ff15-48be-b077-83035db76d32 <![CDATA[A denotationally-based program logic for higher-order store]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=96bbbc75-39aa-4a1d-96dd-7aa749a4648c&tx_pure_pure5%5BshowType%5D=pub&cHash=2017de5b97826f921a45efb5c36caaf9 Aagaard, F. L., Sterling, J., Birkedal, L. Forskning Sun, 01 Jan 2023 02:21:40 +0100 96bbbc75-39aa-4a1d-96dd-7aa749a4648c <![CDATA[Step-Indexed Logical Relations for Countable Nondeterminism and Probabilistic Choice]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=ec8e5f59-0d1a-4feb-a6c6-b44352300da7&tx_pure_pure5%5BshowType%5D=pub&cHash=b4a90c27439c056d5bc3da816bb3beb7 Aguirre, A., Birkedal, L. Developing denotational models for higher-order languages that combine probabilistic and nondeterministic choice is known to be very challenging. In this paper, we propose an alternative approach based on operational techniques. We study a higher-order language combining parametric polymorphism, recursive types, discrete probabilistic choice and countable nondeterminism. We define probabilistic generalizations of may- and must-termination as the optimal and pessimal probabilities of termination. Then we define step-indexed logical relations and show that they are sound and complete with respect to the induced contextual preorders. For may-equivalence we use step-indexing over the natural numbers whereas for must-equivalence we index over the countable ordinals. We then show than the probabilities of may- and must-termination coincide with the maximal and minimal probabilities of termination under all schedulers. Finally we derive the equational theory induced by contextual equivalence and show that it validates the distributive combination of the algebraic theories for probabilistic and nondeterministic choice.

]]>
Forskning Mon, 09 Jan 2023 02:21:40 +0100 ec8e5f59-0d1a-4feb-a6c6-b44352300da7
<![CDATA[Melocoton]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=a0f2e09f-035c-47dd-86a4-922a2d03c726&tx_pure_pure5%5BshowType%5D=pub&cHash=47b060525359f62ff5ee4a9391b3b1be Guéneau, A., Hostert, J., Spies, S., Sammler, M., Birkedal, L., Dreyer, D. In recent years, there has been tremendous progress on developing program logics for verifying the correctness of programs in a rich and diverse array of languages. Thus far, however, such logics have assumed that programs are written entirely in a single programming language. In practice, this assumption rarely holds since programs are often composed of components written in different programming languages, which interact with one another via some kind of foreign function interface (FFI). In this paper, we take the first steps towards the goal of developing program logics for multi-language verification. Specifically, we present Melocoton, a multi-language program verification system for reasoning about OCaml, C, and their interactions through the OCaml FFI. Melocoton consists of the first formal semantics of (a large subset of) the OCaml FFI - previously only described in prose in the OCaml manual - as well as the first program logic to reason about the interactions of program components written in OCaml and C. Melocoton is fully mechanized in Coq on top of the Iris separation logic framework.

]]>
Forskning Sun, 01 Oct 2023 02:21:40 +0200 a0f2e09f-035c-47dd-86a4-922a2d03c726
<![CDATA[Spirea]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=03f75309-bb4e-47a1-9a69-ad1fcbf81211&tx_pure_pure5%5BshowType%5D=pub&cHash=4e0d463f47d79feb4b28eefc6c6ab26f Vindum, S. F., Birkedal, L. Weak persistent memory (a.k.a. non-volatile memory) is an emerging technology that offers fast byte-addressable durable main memory. A wealth of algorithms and libraries has been developed to explore this exciting technology. As noted by others, this has led to a significant verification gap. Towards closing this gap, we present Spirea, the first concurrent separation logic for verification of programs under a weak persistent memory model. Spirea is based on the Iris and Perennial verification frameworks, and by combining features from these logics with novel techniques it supports high-level modular reasoning about crash-safe and thread-safe programs and libraries. Spirea is fully mechanized in the Coq proof assistant and allows for interactive development of proofs with the Iris Proof Mode. We use Spirea to verify several challenging examples with modular specifications. We show how our logic can verify thread-safety and crash-safety of non-blocking durable data structures with null-recovery, in particular the Treiber stack and the Michael-Scott queue adapted to persistent memory. This is the first time durable data structures have been verified with a program logic.

]]>
Forskning Sun, 01 Oct 2023 02:21:40 +0200 03f75309-bb4e-47a1-9a69-ad1fcbf81211
<![CDATA[Fast and Efficient Boolean Unification for Hindley-Milner-Style Type and Effect Systems]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=7cd567a8-4b95-4985-a592-5f8f354ff598&tx_pure_pure5%5BshowType%5D=pub&cHash=3eb1d0f542cef9d53e8c0e977e5d1c56 Madsen, M., Van De Pol, J., Henriksen, T. As type and effect systems become more expressive there is an increasing need for efficient type inference. We consider a polymorphic effect system based on Boolean formulas where inference requires Boolean unification. Since Boolean unification involves semantic equivalence, conventional syntax-driven unification is insufficient. At the same time, existing Boolean unification techniques are ill-suited for type inference. We propose a hybrid algorithm for solving Boolean unification queries based on Boole's Successive Variable Elimination (SVE) algorithm. The proposed approach builds on several key observations regarding the Boolean unification queries encountered in practice, including: (i) most queries are simple, (ii) most queries involve a few flexible variables, (iii) queries are likely to repeat due similar programming patterns, and (iv) there is a long tail of complex queries. We exploit these observations to implement several strategies for formula minimization, including ones based on tabling and binary decision diagrams. We implement the new hybrid approach in the Flix programming language. Experimental results show that by reducing the overhead of Boolean unification, the compilation throughput increases from 8,580 lines/sec to 15,917 lines/sec corresponding to a 1.8x speed-up. Further, the overhead on type and effect inference time is only 16% which corresponds to an overhead of less than 7% on total compilation time. We study the hybrid approach and demonstrate that each design choice improves performance.

]]>
Forskning Sun, 01 Oct 2023 02:21:40 +0200 7cd567a8-4b95-4985-a592-5f8f354ff598
<![CDATA[Finitary Type Theories With and Without Contexts]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=7ddc2ac9-8f3d-4a52-a91a-bbeb61d71457&tx_pure_pure5%5BshowType%5D=pub&cHash=37b84669bd01b5344a96f49d3499a3aa Haselwarter, P. G., Bauer, A. We give a definition of finitary type theories that subsumes many examples of dependent type theories, such as variants of Martin–Löf type theory, simple type theories, first-order and higher-order logics, and homotopy type theory. We prove several general meta-theorems about finitary type theories: weakening, admissibility of substitution and instantiation of metavariables, derivability of presuppositions, uniqueness of typing, and inversion principles. We then give a second formulation of finitary type theories in which there are no explicit contexts. Instead, free variables are explicitly annotated with their types. We provide translations between finitary type theories with and without contexts, thereby showing that they have the same expressive power. The context-free type theory is implemented in the nucleus of the Andromeda 2 proof assistant.

]]>
Forskning Fri, 01 Dec 2023 02:21:40 +0100 7ddc2ac9-8f3d-4a52-a91a-bbeb61d71457
<![CDATA[SSProve]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=1e610b43-3ec3-4bc1-a847-f069e0756a3e&tx_pure_pure5%5BshowType%5D=pub&cHash=40b82aa61421cda82e6a3e2c8f5e3b4a Haselwarter, P. G., Rivas, E., Van Muylder, A., et al. State-separating proofs (SSP) is a recent methodology for structuring game-based cryptographic proofs in a modular way, by using algebraic laws to exploit the modular structure of composed protocols. While promising, this methodology was previously not fully formalized and came with little tool support. We address this by introducing SSProve, the first general verification framework for machine-checked state-separating proofs. SSProve combines high-level modular proofs about composed protocols, as proposed in SSP, with a probabilistic relational program logic for formalizing the lower-level details, which together enable constructing machine-checked cryptographic proofs in the Coq proof assistant. Moreover, SSProve is itself fully formalized in Coq, including the algebraic laws of SSP, the soundness of the program logic, and the connection between these two verification styles.To illustrate SSProve, we use it to mechanize the simple security proofs of ElGamal and pseudo-random-function-based encryption. We also validate the SSProve approach by conducting two more substantial case studies: First, we mechanize an SSP security proof of the key encapsulation mechanism-data encryption mechanism (KEM-DEM) public key encryption scheme, which led to the discovery of an error in the original paper proof that has since been fixed. Second, we use SSProve to formally prove security of the sigma-protocol zero-knowledge construction, and we moreover construct a commitment scheme from a sigma-protocol to compare with a similar development in CryptHOL. We instantiate the security proof for sigma-protocols to give concrete security bounds for Schnorr's sigma-protocol.

]]>
Forskning Sat, 01 Jul 2023 02:21:40 +0200 1e610b43-3ec3-4bc1-a847-f069e0756a3e
<![CDATA[Predicting Memory Demands of BDD Operations using Maximum Graph Cuts]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=55ccbb64-d0e2-40f3-8c66-a085f2ee78f8&tx_pure_pure5%5BshowType%5D=pub&cHash=130fcb9ab21b39c5c9b80938e3e891c7 Sølvsten, S., van de Pol, J.
The contents of these auxiliary data structures always correspond to a graph cut in an input or output BDD. Specifically, these cuts respect the levels of the BDD. We formalise the shape of these cuts and prove sound upper bounds on their maximum size for each BDD operation.

We have implemented these upper bounds within Adiar. With these bounds, it can predict whether a faster internal memory variant of the auxiliary data structures can be used. In practice, this improves Adiar’s running time across the board. Specifically for the moderate-sized BDDs, this results in an average reduction of the computation time by 86.1% (median of 89.7%). In some cases, the difference is even 99.9%. When checking equivalence of hardware circuits from the EPFL Benchmark Suite, for one of the instances the time was decreased by 52 h.]]>
Forskning Sun, 01 Oct 2023 02:21:40 +0200 55ccbb64-d0e2-40f3-8c66-a085f2ee78f8
<![CDATA[Verifying Reliable Network Components in a Distributed Separation Logic with Dependent Separation Protocols]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=5b0ef8ae-4be0-4077-ab93-240870492250&tx_pure_pure5%5BshowType%5D=pub&cHash=0d15aeed6179fe9dbe2ee24e9c4e817a Gondelman, L., Hinrichsen, J. K., Pereira, M., Timany, A., Birkedal, L. We present a foundationally verified implementation of a reliable communication library for asynchronous client-server communication, and a stack of formally verified components on top thereof. Our library is implemented in an OCaml-like language on top of UDP and features characteristic traits of existing protocols, such as a simple handshaking protocol, bidirectional channels, and retransmission/acknowledgement mechanisms. We verify the library in the Aneris distributed separation logic using a novel proof pattern - -dubbed the session escrow pattern - -based on the existing escrow proof pattern and the so-called dependent separation protocols, which hitherto have only been used in a non-distributed concurrent setting. We demonstrate how our specification of the reliable communication library simplifies formal reasoning about applications, such as a remote procedure call library, which we in turn use to verify a lazily replicated key-value store with leader-followers and clients thereof. Our development is highly modular - -each component is verified relative to specifications of the components it uses (not the implementation). All our results are formalized in the Coq proof assistant.

]]>
Forskning Tue, 01 Aug 2023 02:21:40 +0200 5b0ef8ae-4be0-4077-ab93-240870492250
<![CDATA[VMSL]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=86004023-0ec2-49c0-9f8e-e521c80a4446&tx_pure_pure5%5BshowType%5D=pub&cHash=46021078140ec40cef71d17bf590a7ad Liu, Z., Stepanenko, S., Pichon-Pharabod, J., Timany, A., Askarov, A., Birkedal, L. Thin hypervisors make it possible to isolate key security components like keychains, fingerprint readers, and digital wallets from the easily-compromised operating system. To work together, virtual machines running on top of the hypervisor can make hypercalls to the hypervisor to share pages between each other in a controlled way. However, the design of such hypercall ABIs remains a delicate balancing task between conflicting needs for expressivity, performance, and security. In particular, it raises the question of what makes the specification of a hypervisor, and of its hypercall ABIs, good enough for the virtual machines. In this paper, we validate the expressivity and security of the design of the hypercall ABIs of Arm's FF-A. We formalise a substantial fragment of FF-A as a machine with a simplified ISA in which hypercalls are steps of the machine. We then develop VMSL, a novel separation logic, which we prove sound with respect to the machine execution model, and use it to reason modularly about virtual machines which communicate through the hypercall ABIs, demonstrating the hypercall ABIs' expressivity. Moreover, we use the logic to prove robust safety of communicating virtual machines, that is, the guarantee that even if some of the virtual machines are compromised and execute unknown code, they cannot break the safety properties of other virtual machines running known code. This demonstrates the intended security guarantees of the hypercall ABIs. All the results in the paper have been formalised in Coq using the Iris framework.

]]>
Forskning Thu, 01 Jun 2023 02:21:40 +0200 86004023-0ec2-49c0-9f8e-e521c80a4446
<![CDATA[Iris-Wasm]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=3e8d1eeb-a0e8-4c2c-91ac-fa5349be0acc&tx_pure_pure5%5BshowType%5D=pub&cHash=206f2c164ef555ceb98780659a8e1fbf Rao, X., Georges, A. L., Legoupil, M., et al. WebAssembly makes it possible to run C/C++ applications on the web with near-native performance. A WebAssembly program is expressed as a collection of higher-order ML-like modules, which are composed together through a system of explicit imports and exports using a host language, enabling a form of higher-order modular programming. We present Iris-Wasm, a mechanized higher-order separation logic building on a specification of Wasm 1.0 mechanized in Coq and the Iris framework. Using Iris-Wasm, we are able to specify and verify individual modules separately, and then compose them modularly in a simple host language featuring the core operations of the WebAssembly JavaScript Interface. Building on Iris-Wasm, we develop a logical relation that enforces robust safety: unknown, adversarial code can only affect other modules through the functions that they explicitly export. Together, the program logic and the logical relation allow us to formally verify functional correctness of WebAssembly programs, even when they invoke and are invoked by unknown code, thereby demonstrating that WebAssembly enforces strong isolation between modules.

]]>
Forskning Thu, 01 Jun 2023 02:21:40 +0200 3e8d1eeb-a0e8-4c2c-91ac-fa5349be0acc
<![CDATA[Optimal Layout Synthesis for Quantum Circuits as Classical Planning]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=7ab10c88-2c17-4a09-a86b-29058e542cb0&tx_pure_pure5%5BshowType%5D=pub&cHash=7cf5d181d31b805ca4fed188fe2d6a71 Shaik, I., van de Pol, J. In Layout Synthesis, the logical qubits of a quantum circuit are mapped to the physical qubits of a given quantum hardware platform, taking into account the connectivity of physical qubits. This involves inserting SWAP gates before an operation is applied on distant qubits. Optimal Layout Synthesis is crucial for practical Quantum Computing on current error-prone hardware: Minimizing the number of SWAP gates directly mitigates the error rates when running quantum circuits. In recent years, several approaches have been proposed for minimizing the required SWAP insertions. The proposed exact approaches can only scale to a small number of qubits. In this paper, we provide two encodings for Optimal Layout Synthesis as a classical planning problem. We use optimal classical planners to synthesize the optimal layout for a standard set of benchmarks. Our results show the scalability of our approach compared to previous leading approaches. We can optimally map circuits with 9 qubits onto a 14 qubit platform, which could not be handled before by exact methods.

]]>
Forskning Sun, 01 Jan 2023 02:21:40 +0100 7ab10c88-2c17-4a09-a86b-29058e542cb0
<![CDATA[Implicit State and Goals in QBF Encodings for Positional Games (extended version)]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=1348d5e9-4140-4ede-bfbc-8ca754a9c129&tx_pure_pure5%5BshowType%5D=pub&cHash=ee438fd4e59eba002452da85b6d5ae32 Shaik, I., Mayer-Eichberger, V., van de Pol, J., Saffidine, A. Forskning Sun, 01 Jan 2023 02:21:40 +0100 1348d5e9-4140-4ede-bfbc-8ca754a9c129 <![CDATA[Concise QBF Encodings for Games on a Grid (extended version)]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=4d104dd0-66bd-410b-99d6-561559f1785a&tx_pure_pure5%5BshowType%5D=pub&cHash=d13f6f7f1596aafa245d8239c6c21e00 Shaik, I., van de Pol, J. Forskning Sun, 01 Jan 2023 02:21:40 +0100 4d104dd0-66bd-410b-99d6-561559f1785a <![CDATA[Syntax and semantics of modal type theory]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=694f77d2-47d3-4986-bb82-129b8d96206e&tx_pure_pure5%5BshowType%5D=pub&cHash=927762ecda6943442adf1b746dfa559f Gratzer, D. under substitution. Modal type theory, by contrast, concerns the controlled inte-
gration of operations—modalities—into type theory which violate this discipline,
so-called non-fibered connectives. Modal type theory is therefore built around a
fundamental tension: the desire to include modalities and powerful principles for
reasoning with them on one hand, and the need to maintain the conveniences and
character of Martin-Löf type theory which stem from substitution invariance.

In this thesis we thoroughly explore and discuss this contradiction. We discuss
several different formulations of modal type theory, explore their various syntactic
properties, and relate them through their categorical semantics. In particular, we
show that most modal type theories that have arisen in the last two decades can be
understood through the abstraction of weak dependent right adjoints. We also put
forward a new general modal type theory, MTT, based around this abstraction.

The generality of MTT means that, without any additional work, it can be
specialized to an arbitrary collection of type theories related by modalities and
natural transformations between them. It is therefore easy to obtain a type theory
for a comonad, an adjunction, a local topos, or any other number of complex and
realistic scenarios. In addition to showing that many modal type theories are closely
related to specific instantiations of MTT, we thoroughly explore the syntax and
semantics of MTT itself. We prove that MTT enjoys an unconditional normalization
result and decidable type-checking under mild assumptions. We show how MTT
may be interpreted into a wide variety of structured categories and use this to study
the expressive power of the type theory and various extensions thereof.

Finally, we explore several concrete applications of MTT in the context of
guarded type theory and guarded denotational semantics. We propose a highly usable
language for guarded recursion and explore its particular models and metatheorems.
We show a relatively sharp result bounding the extent to which classical guarded
recursion can be added to any type theory with decidable type-checking and propose
a system to mitigate this issue. Finally, we conduct an in-depth case study using
guarded MTT to obtain a fully synthetic account of the Iris program logic, proving
adequacy in a fully internal manner.]]>
Forskning Sun, 01 Oct 2023 02:21:40 +0200 694f77d2-47d3-4986-bb82-129b8d96206e
<![CDATA[Under Lock and Key]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=b2d7355e-8174-464d-b495-a63588cbde48&tx_pure_pure5%5BshowType%5D=pub&cHash=313dd1fb0948d3283db8264e6305b37d Kavvos, G. A., Gratzer, D. We present a proof system for a multimode and multimodal logic, which is based on our previous work on modal Martin-Löf type theory. The specification of modes, modalities, and implications between them is given as a mode theory, i.e., a small 2-category. The logic is extended to a lambda calculus, establishing a Curry-Howard correspondence.

]]>
Forskning Tue, 20 Jun 2023 02:21:40 +0200 b2d7355e-8174-464d-b495-a63588cbde48
<![CDATA[mitten]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=52562f19-2cf3-4c41-b554-2a4dc37daca7&tx_pure_pure5%5BshowType%5D=pub&cHash=888cfb876018c32dc37bcd65301e7c24 Stassen, P. J. A., Gratzer, D., Birkedal, L. Recently, there has been a growing interest in type theories which include modalities, unary type constructors which need not commute with substitution. Here we focus on MTT [15], a general modal type theory which can internalize arbitrary collections of (dependent) right adjoints [7]. These modalities are specified by mode theories [20], 2-categories whose objects corresponds to modes, morphisms to modalities, and 2-cells to natural transformations between modalities. We contribute a defunctionalized NbE algorithm which reduces the type-checking problem for MTT to deciding the word problem for the mode theory. The algorithm is restricted to the class of preordered mode theories – mode theories with at most one 2-cell between any pair of modalities. Crucially, the normalization algorithm does not depend on the particulars of the mode theory and can be applied without change to any preordered collection of modalities. Furthermore, we specify a bidirectional syntax for MTT together with a type-checking algorithm. We further contribute mitten, a flexible experimental proof assistant implementing these algorithms which supports all decidable preordered mode theories without alteration.

]]>
Forskning Tue, 01 Aug 2023 02:21:40 +0200 52562f19-2cf3-4c41-b554-2a4dc37daca7
<![CDATA[Programming with Purity Reflection]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=b26a5ca0-09d3-491f-b975-4c4f97b87649&tx_pure_pure5%5BshowType%5D=pub&cHash=9f777aa5e0d266e733607e56b1d4cef4 Madsen, M., Pol, J. v. d. We propose several new data structures that use purity reflection to switch between eager and lazy, sequential and parallel evaluation. We propose a DelayList, which is maximally lazy but switches to eager evaluation for impure operations. We also propose a DelayMap which is maximally lazy in its values, but also exploits eager and parallel evaluation.
We implement purity reflection as an extension of the Flix programming language. We present a new effect-aware form of monomorphization that eliminates purity reflection at compile-time. And finally, we evaluate the cost of this new monomorphization on compilation time and on code size, and determine that it is minimal. ]]>
Forskning Sat, 01 Jul 2023 02:21:40 +0200 b26a5ca0-09d3-491f-b975-4c4f97b87649
<![CDATA[A Truly Symbolic Linear-Time Algorithm for SCC Decomposition]]> https://cs.au.dk/da/research/logic-and-semantics/publications?tx_pure_pure5%5Baction%5D=single&tx_pure_pure5%5Bcontroller%5D=Publications&tx_pure_pure5%5Bid%5D=9cf24d7f-c463-4618-956d-0bc2d2e0bd66&tx_pure_pure5%5BshowType%5D=pub&cHash=66b5deb0c727b6b38ecd8e1535ef7271 Larsen, C. A., Schmidt, S. M., Steensgaard, J., Jakobsen, A. B., Pol, J. v. d., Pavlogiannis, A. Forskning Sat, 01 Apr 2023 02:21:40 +0200 9cf24d7f-c463-4618-956d-0bc2d2e0bd66