11,649 research outputs found
Data Definitions in the ACL2 Sedan
We present a data definition framework that enables the convenient
specification of data types in ACL2s, the ACL2 Sedan. Our primary motivation
for developing the data definition framework was pedagogical. We were teaching
undergraduate students how to reason about programs using ACL2s and wanted to
provide them with an effective method for defining, testing, and reasoning
about data types in the context of an untyped theorem prover. Our framework is
now routinely used not only for pedagogical purposes, but also by advanced
users.
Our framework concisely supports common data definition patterns, e.g. list
types, map types, and record types. It also provides support for polymorphic
functions. A distinguishing feature of our approach is that we maintain both a
predicative and an enumerative characterization of data definitions.
In this paper we present our data definition framework via a sequence of
examples. We give a complete characterization in terms of tau rules of the
inclusion/exclusion relations a data definition induces, under suitable
restrictions. The data definition framework is a key component of
counterexample generation support in ACL2s, but can be independently used in
ACL2, and is available as a community book.Comment: In Proceedings ACL2 2014, arXiv:1406.123
Polymorphic Types in ACL2
This paper describes a tool suite for the ACL2 programming language which
incorporates certain ideas from the Hindley-Milner paradigm of functional
programming (as exemplified in popular languages like ML and Haskell),
including a "typed" style of programming with the ability to define polymorphic
types. These ideas are introduced via macros into the language of ACL2, taking
advantage of ACL2's guard-checking mechanism to perform type checking on both
function definitions and theorems. Finally, we discuss how these macros were
used to implement features of Specware, a software specification and
implementation system.Comment: In Proceedings ACL2 2014, arXiv:1406.123
Parametricity and Local Variables
We propose that the phenomenon of local state may be understood in terms of Strachey\u27s concept of parametric (i.e., uniform) polymorphism. The intuitive basis for our proposal is the following analogy: a non-local procedure is independent of locally-declared variables in the same way that a parametrically polymorphic function is independent of types to which it is instantiated. A connection between parametricity and representational abstraction was first suggested by J. C. Reynolds. Reynolds used logical relations to formalize this connection in languages with type variables and user-defined types. We use relational parametricity to construct a model for an Algol-like language in which interactions between local and non-local entities satisfy certain relational criteria. Reasoning about local variables essentially involves proving properties of polymorphic functions. The new model supports straightforward validations of all the test equivalences that have been proposed in the literature for local-variable semantics, and encompasses standard methods of reasoning about data representations. It is not known whether our techniques yield fully abstract semantics. A model based on partial equivalence relations on the natural numbers is also briefly examined
Synthesis of Recursive ADT Transformations from Reusable Templates
Recent work has proposed a promising approach to improving scalability of
program synthesis by allowing the user to supply a syntactic template that
constrains the space of potential programs. Unfortunately, creating templates
often requires nontrivial effort from the user, which impedes the usability of
the synthesizer. We present a solution to this problem in the context of
recursive transformations on algebraic data-types. Our approach relies on
polymorphic synthesis constructs: a small but powerful extension to the
language of syntactic templates, which makes it possible to define a program
space in a concise and highly reusable manner, while at the same time retains
the scalability benefits of conventional templates. This approach enables
end-users to reuse predefined templates from a library for a wide variety of
problems with little effort. The paper also describes a novel optimization that
further improves the performance and scalability of the system. We evaluated
the approach on a set of benchmarks that most notably includes desugaring
functions for lambda calculus, which force the synthesizer to discover Church
encodings for pairs and boolean operations
- …