797 research outputs found
Gradual Certified Programming in Coq
Expressive static typing disciplines are a powerful way to achieve
high-quality software. However, the adoption cost of such techniques should not
be under-estimated. Just like gradual typing allows for a smooth transition
from dynamically-typed to statically-typed programs, it seems desirable to
support a gradual path to certified programming. We explore gradual certified
programming in Coq, providing the possibility to postpone the proofs of
selected properties, and to check "at runtime" whether the properties actually
hold. Casts can be integrated with the implicit coercion mechanism of Coq to
support implicit cast insertion a la gradual typing. Additionally, when
extracting Coq functions to mainstream languages, our encoding of casts
supports lifting assumed properties into runtime checks. Much to our surprise,
it is not necessary to extend Coq in any way to support gradual certified
programming. A simple mix of type classes and axioms makes it possible to bring
gradual certified programming to Coq in a straightforward manner.Comment: DLS'15 final version, Proceedings of the ACM Dynamic Languages
Symposium (DLS 2015
Combining behavioural types with security analysis
Today's software systems are highly distributed and interconnected, and they
increasingly rely on communication to achieve their goals; due to their
societal importance, security and trustworthiness are crucial aspects for the
correctness of these systems. Behavioural types, which extend data types by
describing also the structured behaviour of programs, are a widely studied
approach to the enforcement of correctness properties in communicating systems.
This paper offers a unified overview of proposals based on behavioural types
which are aimed at the analysis of security properties
A Framework for Resource Dependent EDSLs in a Dependently Typed Language (Pearl)
Idris' Effects library demonstrates how to embed resource dependent algebraic effect handlers into a dependently typed host language, providing run-time and compile-time based reasoning on type-level resources. Building upon this work, Resources is a framework for realising Embedded Domain Specific Languages (EDSLs) with type systems that contain domain specific substructural properties. Differing from Effects, Resources allows a language’s substructural properties to be encoded within type-level resources that are associated with language variables. Such an association allows for multiple effect instances to be reasoned about autonomically and without explicit type-level declaration. Type-level predicates are used as proof that the language’s substructural properties hold. Several exemplar EDSLs are presented that illustrates our framework’s operation and how dependent types provide correctness-by-construction guarantees that substructural properties of written programs hold
A Typing Discipline for Hardware Interfaces
Modern Systems-on-a-Chip (SoC) are constructed by composition of IP (Intellectual Property) Cores with the communication between these IP Cores being governed by well described interaction protocols. However, there is a disconnect between the machine readable specification of these protocols and the verification of their implementation in known hardware description languages. Although tools can be written to address such separation of concerns, the tooling is often hand written and used to check hardware designs a posteriori. We have developed a dependent type-system and proof-of-concept modelling language to reason about the physical structure of hardware interfaces using user provided descriptions. Our type-system provides correct-by-construction guarantees that the interfaces on an IP Core will be well-typed if they adhere to a specified standard
Approximate Normalization for Gradual Dependent Types
Dependent types help programmers write highly reliable code. However, this
reliability comes at a cost: it can be challenging to write new prototypes in
(or migrate old code to) dependently-typed programming languages. Gradual
typing makes static type disciplines more flexible, so an appropriate notion of
gradual dependent types could fruitfully lower this cost. However, dependent
types raise unique challenges for gradual typing. Dependent typechecking
involves the execution of program code, but gradually-typed code can signal
runtime type errors or diverge. These runtime errors threaten the soundness
guarantees that make dependent types so attractive, while divergence spoils the
type-driven programming experience.
This paper presents GDTL, a gradual dependently-typed language that
emphasizes pragmatic dependently-typed programming. GDTL fully embeds both an
untyped and dependently-typed language, and allows for smooth transitions
between the two. In addition to gradual types we introduce gradual terms ,
which allow the user to be imprecise in type indices and to omit proof terms;
runtime checks ensure type safety . To account for nontermination and failure,
we distinguish between compile-time normalization and run-time execution:
compile-time normalization is approximate but total, while runtime execution is
exact , but may fail or diverge. We prove that GDTL has decidable typechecking
and satisfies all the expected properties of gradual languages. In particular,
GDTL satisfies the static and dynamic gradual guarantees: reducing type
precision preserves typedness, and altering type precision does not change
program behavior outside of dynamic type failures. To prove these properties,
we were led to establish a novel normalization gradual guarantee that captures
the monotonicity of approximate normalization with respect to imprecision
Meta-F*: Proof Automation with SMT, Tactics, and Metaprograms
We introduce Meta-F*, a tactics and metaprogramming framework for the F*
program verifier. The main novelty of Meta-F* is allowing the use of tactics
and metaprogramming to discharge assertions not solvable by SMT, or to just
simplify them into well-behaved SMT fragments. Plus, Meta-F* can be used to
generate verified code automatically.
Meta-F* is implemented as an F* effect, which, given the powerful effect
system of F*, heavily increases code reuse and even enables the lightweight
verification of metaprograms. Metaprograms can be either interpreted, or
compiled to efficient native code that can be dynamically loaded into the F*
type-checker and can interoperate with interpreted code. Evaluation on
realistic case studies shows that Meta-F* provides substantial gains in proof
development, efficiency, and robustness.Comment: Full version of ESOP'19 pape
- …