-
Verifying the Hashgraph Consensus Algorithm
Authors:
Karl Crary
Abstract:
The Hashgraph consensus algorithm is an algorithm for asynchronous Byzantine fault tolerance intended for distributed shared ledgers. Its main distinguishing characteristic is it achieves consensus without exchanging any extra messages; each participant's votes can be determined from public information, so votes need not be transmitted.
In this paper, we discuss our experience formalizing the Ha…
▽ More
The Hashgraph consensus algorithm is an algorithm for asynchronous Byzantine fault tolerance intended for distributed shared ledgers. Its main distinguishing characteristic is it achieves consensus without exchanging any extra messages; each participant's votes can be determined from public information, so votes need not be transmitted.
In this paper, we discuss our experience formalizing the Hashgraph algorithm and its correctness proof using the Coq proof assistant. The paper is self-contained; it includes a complete discussion of the algorithm and its correctness argument in English.
△ Less
Submitted 1 February, 2021;
originally announced February 2021.
-
Compiling a Calculus for Relaxed Memory: Practical constraint-based low-level concurrency
Authors:
Michael J. Sullivan,
Karl Crary,
Salil Joshi
Abstract:
Crary and Sullivan's Relaxed Memory Calculus (RMC) proposed a new declarative approach for writing low-level shared memory concurrent programs in the presence of modern relaxed-memory multi-processor architectures and optimizing compilers. In RMC, the programmer explicitly specifies constraints on the order of execution of operations and on the visibility of memory writes. These constraints are th…
▽ More
Crary and Sullivan's Relaxed Memory Calculus (RMC) proposed a new declarative approach for writing low-level shared memory concurrent programs in the presence of modern relaxed-memory multi-processor architectures and optimizing compilers. In RMC, the programmer explicitly specifies constraints on the order of execution of operations and on the visibility of memory writes. These constraints are then enforced by the compiler, which has a wide degree of latitude in how to accomplish its goals.
We present rmc-compiler, a Clang and LLVM-based compiler for RMC-extended C and C++. In addition to using barriers to enforce ordering, rmc-compiler can take advantage of control and data dependencies, something that is beyond the abilities of current C/C++ compilers. In rmc-compiler, RMC compilation is modeled as an SMT problem with a cost term; the solution with the minimum cost determines the compilation strategy. In testing on ARM and POWER devices, RMC performs quite well, with modest performance improvements relative to C++11 on most of our data structure benchmarks and (on some architectures) dramatic improvements on a read-mostly list test that heavily benefits from use of data dependencies for ordering.
△ Less
Submitted 10 April, 2019;
originally announced April 2019.
-
Hygienic Source-Code Generation Using Functors
Authors:
Karl Crary
Abstract:
Existing source-code-generating tools such as Lex and Yacc suffer from practical inconveniences because they use disembodied code to implement actions. To prevent this problem, such tools could generate closed functors that are then instantiated by the programmer with appropriate action code. This results in all code being type checked in its appropriate context, and it assists the type checker in…
▽ More
Existing source-code-generating tools such as Lex and Yacc suffer from practical inconveniences because they use disembodied code to implement actions. To prevent this problem, such tools could generate closed functors that are then instantiated by the programmer with appropriate action code. This results in all code being type checked in its appropriate context, and it assists the type checker in localizing errors correctly. We have implemented a lexer generator and parser generator based on this technique for Standard ML, OCaml, and Haskell.
△ Less
Submitted 4 January, 2018;
originally announced January 2018.
-
TWAM: A Certifying Abstract Machine for Logic Programs
Authors:
Rose Bohrer,
Karl Crary
Abstract:
Type-preserving (or typed) compilation uses ty** derivations to certify correctness properties of compilation. We have designed and implemented a type-preserving compiler for a simply-typed dialect of Prolog we call T-Prolog. The crux of our approach is a new certifying abstract machine which we call the Typed Warren Abstract Machine (TWAM). The TWAM has a dependent type system strong enough t…
▽ More
Type-preserving (or typed) compilation uses ty** derivations to certify correctness properties of compilation. We have designed and implemented a type-preserving compiler for a simply-typed dialect of Prolog we call T-Prolog. The crux of our approach is a new certifying abstract machine which we call the Typed Warren Abstract Machine (TWAM). The TWAM has a dependent type system strong enough to specify the semantics of a logic program in the logical framework LF. We present a soundness metatheorem which constitutes a partial correctness guarantee: well-typed programs implement the logic program specified by their type. This metatheorem justifies our design and implementation of a certifying compiler from T-Prolog to TWAM.
△ Less
Submitted 1 January, 2018;
originally announced January 2018.
-
Proceedings 5th International Workshop on Logical Frameworks and Meta-languages: Theory and Practice
Authors:
Karl Crary,
Marino Miculan
Abstract:
Type theories, logical frameworks and meta-languages form a common foundation for designing, implementing, and reasoning about formal languages and their semantics. They are central to the design of modern programming languages, certified software, and domain specific logics. More generally, they continue to influence applications in many areas in mathematics, logic and computer science.
The Log…
▽ More
Type theories, logical frameworks and meta-languages form a common foundation for designing, implementing, and reasoning about formal languages and their semantics. They are central to the design of modern programming languages, certified software, and domain specific logics. More generally, they continue to influence applications in many areas in mathematics, logic and computer science.
The Logical Frameworks and Meta-languages: Theory and Practice workshop aims to bring together designers, implementers, and practitioners working on these areas, and in particular about: the automation and implementation of the meta-theory of programming languages and related calculi; the design of proof assistants, automated theorem provers, and formal digital libraries building upon logical framework technology; theoretical and practical issues concerning the encoding of variable binding and fresh name generation, especially the representation of, and reasoning about, datatypes defined from binding signatures; case studies of meta-programming, and the mechanization of the (meta) theory of descriptions of programming languages and other calculi.
This volume contains the final and revised versions of the papers presented at LFMTP 2010, which was held on July 14, 2010 in Edinburgh (UK). LFMTP 2010 was part of the Federated Logic Conference (FLoC 2010), and affilated with LICS 2010.
△ Less
Submitted 11 September, 2010;
originally announced September 2010.
-
Logic Column 16: Higher-Order Abstract Syntax: Setting the Record Straight
Authors:
Karl Crary,
Robert Harper
Abstract:
This article responds to a critique of higher-order abstract syntax appearing in Logic Column 14, ``Nominal Logic and Abstract Syntax'', cs.LO/0511025.
This article responds to a critique of higher-order abstract syntax appearing in Logic Column 14, ``Nominal Logic and Abstract Syntax'', cs.LO/0511025.
△ Less
Submitted 31 July, 2006;
originally announced July 2006.