4 research outputs found

    Planning problems as types, plans as programs : a dependent types infrastructure for verification and reasoning about automated plans in Agda

    Get PDF
    Historically, the Artificial Intelligence and programming language fields have had a mutually beneficial relationship. Typically, theoretical results in the programming language field have practical utility in the Artificial Intelligence field. One example of this that has roots in both declarative languages and theorem proving is AI planning. In recent years, new programming languages have been developed that are founded on dependent type theory. These languages are not only more expressive than traditional programming languages but also have the ability to represent and prove mathematical properties within the language. This thesis will explore how dependently typed languages can benefit the AI planning field. On one side this thesis will show how AI planning languages can be enriched with more expressivity and stronger verification guarantees. On the other, it will show that AI planning is an ideal field to illustrate the practical utility of largely theoretical aspects of programming language theory. This thesis will accomplish this by implementing multiple inference systems for plan validation in the dependently-typed programming language Agda. Importantly, these inference systems will be automated, and embody the Curry-Howard correspondence where plans will not only be proof-terms but also executable functions. This thesis will then show how the dependently-typed implementations of the inference systems can be further utilised to add enriched constraints over plan validation

    Verification of Smart Contracts using the Interactive Theorem Prover Agda

    Get PDF
    The goal of this thesis is to verify smart contracts in Blockchain. In particular, we focus on smart contracts in Bitcoin and Solidity. In order to specify the correctness of smart contracts, we use weakest preconditions. For this, we develop a model of smart contracts in the interactive theorem prover and dependent type programming language Agda and prove the correctness of smart contracts in it. In the context of Bitcoin, our verification of Bitcoin scripts consists of non-conditional and conditional scripts. For Solidity, we refer to programs using object-oriented features of Solidity, such as calling of other contracts, full recursion, and the use of gas in order to guarantee termination while having a Turing-complete language. We have developed a simulator for Solidity-style smart contracts. As a main example, we executed a reentrancy attack in our model. We have verified smart contracts in Bitcoin and Solidity using weakest precondition in Agda. Furthermore, Agda, combined with the fact that it is a theorem prover and programming language, allows the writing of verified programs, where the verification takes place in the same language in which the program is written, avoiding the problem of translation from one language to another (with possible translation mistakes)

    Verified compilation from BitML to Bitcoin: an Agda odyssey

    Get PDF
    Blockchain technology has taken the financial world by storm in recent years, allowing for programmable contracts to be enacted amongst participants in a decentralised fashion. Bugs in those programs, however, can lead to huge monetary losses and cannot in principle be amended after detection, due to the blockchain being an immutable data structure. This incentivizes a high-assurance approach to developing smart contracts, which so far has mainly consisted of approximate methods of static analysis. Here, we strive for something more radical, namely the use of interactive proof assistants grounded in Type Theory to develop such contracts and formally verify their correctness by proving logical propositions within the same system. Specifically, we take existing work on the Bitcoin Modelling Language (BitML) — a high-level process calculus for expressing contracts that compile down to Bitcoin transactions — and encode its definitions, semantics, and translation procedure in the Agda proof assistant. BitML is one of the most mature works at the confluence of Blockchain and Programming Languages, which justifies the tremendous amount of effort required to mechanise the intricate results of the original paper, compared to various more lightweight alternatives such as model checking. We can then prove properties about BitML contracts as Agda programs, in particular the main meta-theoretical result of the BitML paper, compilation correctness, which states that it suffices to prove properties at the more abstract level of BitML contracts, and then provably transfer them to the low-level of Bitcoin transactions. By virtue of working in a type-theoretic proof assistant whose underlying logic is constructive, we can say that the central research goal of this thesis amounts to producing a verified compiler from BitML contracts to Bitcoin transactions. This whole dissertation is a type-checked Agda script, and the corresponding formalisations are publicly available in HTML format: - https://omelkonian.github.io/formal-bitcoin/ - https://omelkonian.github.io/formal-bitml/ - https://omelkonian.github.io/formal-bitml-to-bitcoin
    corecore