Contracts made manifest

2012 ◽  
Vol 22 (3) ◽  
pp. 225-274 ◽  
Author(s):  
MICHAEL GREENBERG ◽  
BENJAMIN C. PIERCE ◽  
STEPHANIE WEIRICH

AbstractSince Findler and Felleisen (Findler, R. B. & Felleisen, M. 2002) introduced higher-order contracts, many variants have been proposed. Broadly, these fall into two groups: some follow Findler and Felleisen (2002) in using latent contracts, purely dynamic checks that are transparent to the type system; others use manifest contracts, where refinement types record the most recent check that has been applied to each value. These two approaches are commonly assumed to be equivalent—different ways of implementing the same idea, one retaining a simple type system, and the other providing more static information. Our goal is to formalize and clarify this folklore understanding. Our work extends that of Gronski and Flanagan (Gronski, J. & Flanagan, C. 2007), who defined a latent calculus λC and a manifest calculus λH, gave a translation φ from λC to λH, and proved that if a λC term reduces to a constant, so does its φ-image. We enrich their account with a translation ψ from λH to λC and prove an analogous theorem. We then generalize the whole framework to dependent contracts, whose predicates can mention free variables. This extension is both pragmatically crucial, supporting a much more interesting range of contracts, and theoretically challenging. We define dependent versions of λH and two dialects (“lax” and “picky”) of λC, establish type soundness—a substantial result in itself, for λH — and extend φ and ψ accordingly. Surprisingly, the intuition that the latent and manifest systems are equivalent now breaks down: the extended translations preserve behavior in one direction, but in the other, sometimes yield terms that blame more.

2020 ◽  
Author(s):  
P Giannini ◽  
Marco Servetto ◽  
E Zucca

Copyright © 2019 for this paper by its authors. We present a type and effect system for tracing and preventing sharing and mutation in imperative languages. That is, on one hand, the type system traces sharing possibly introduced by the evaluation of an expression, so that uniqueness and immutability properties can be easily detected. On the other hand, sharing and mutation can be prevented by type qualifiers which forbid some actions. Sharing is directly represented at the syntactic level as a relation among free variables, thanks to the fact that in the underlying calculus memory is encoded in terms.


Author(s):  
Yuki Nishida ◽  
Hiromasa Saito ◽  
Ran Chen ◽  
Akira Kawata ◽  
Jun Furuse ◽  
...  

AbstractA smart contract is a program executed on a blockchain, based on which many cryptocurrencies are implemented, and is being used for automating transactions. Due to the large amount of money that smart contracts deal with, there is a surging demand for a method that can statically and formally verify them.This tool paper describes our type-based static verification tool Helmholtz for Michelson, which is a statically typed stack-based language for writing smart contracts that are executed on the blockchain platform Tezos. Helmholtz is designed on top of our extension of Michelson’s type system with refinement types. Helmholtz takes a Michelson program annotated with a user-defined specification written in the form of a refinement type as input; it then typechecks the program against the specification based on the refinement type system, discharging the generated verification conditions with the SMT solver Z3. We briefly introduce our refinement type system for the core calculus Mini-Michelson of Michelson, which incorporates the characteristic features such as compound datatypes (e.g., lists and pairs), higher-order functions, and invocation of another contract. Helmholtz successfully verifies several practical Michelson programs, including one that transfers money to an account and that checks a digital signature.


2020 ◽  
Author(s):  
P Giannini ◽  
Marco Servetto ◽  
E Zucca

Copyright © 2019 for this paper by its authors. We present a type and effect system for tracing and preventing sharing and mutation in imperative languages. That is, on one hand, the type system traces sharing possibly introduced by the evaluation of an expression, so that uniqueness and immutability properties can be easily detected. On the other hand, sharing and mutation can be prevented by type qualifiers which forbid some actions. Sharing is directly represented at the syntactic level as a relation among free variables, thanks to the fact that in the underlying calculus memory is encoded in terms.


2020 ◽  
Vol 25 (3) ◽  
pp. 49
Author(s):  
Silvia Licciardi ◽  
Rosa Maria Pidatella ◽  
Marcello Artioli ◽  
Giuseppe Dattoli

In this paper, we show that the use of methods of an operational nature, such as umbral calculus, allows achieving a double target: on one side, the study of the Voigt function, which plays a pivotal role in spectroscopic studies and in other applications, according to a new point of view, and on the other, the introduction of a Voigt transform and its possible use. Furthermore, by the same method, we point out that the Hermite and Laguerre functions, extension of the corresponding polynomials to negative and/or real indices, can be expressed through a definition in a straightforward and unified fashion. It is illustrated how the techniques that we are going to suggest provide an easy derivation of the relevant properties along with generalizations to higher order functions.


1995 ◽  
Vol 5 (1) ◽  
pp. 1-35 ◽  
Author(s):  
Mark P. Jones

AbstractThis paper describes a flexible type system that combines overloading and higher-order polymorphism in an implicitly typed language using a system of constructor classes—a natural generalization of type classes in Haskell. We present a range of examples to demonstrate the usefulness of such a system. In particular, we show how constructor classes can be used to support the use of monads in a functional language. The underlying type system permits higher-order polymorphism but retains many of the attractive features that have made Hindley/Milner type systems so popular. In particular, there is an effective algorithm that can be used to calculate principal types without the need for explicit type or kind annotations. A prototype implementation has been developed providing, amongst other things, the first concrete implementation of monad comprehensions known to us at the time of writing.


2000 ◽  
Vol 10 (3) ◽  
pp. 361-372 ◽  
Author(s):  
VINCENT PADOVANI

Higher Order Matching consists of solving finite sets of equations of the form u =βηv, where u, v are simply typed terms of λ-calculus, and v is a closed term. Whether this problem is decidable is an open question. In this paper its decidability is proved when the free variables of all equations are of order at most 4 – we actually extend this result to a more general situation in which in addition to equations, disequations are also considered.


A neural model is presented, based largely on evidence from studies in monkeys, postulating that coded representations of stimuli are stored in the higher-order sensory (i.e. association) areas of the cortex whenever stimulus activation of these areas also triggers a cortico-limbo-thalamo-cortical circuit. This circuit, which could act as either an imprinting or rehearsal mechanism, may actually consist of two parallel circuits, one involving the amygdala and the dorsomedial nucleus of the thalamus, and the other the hippocampus and the anterior nuclei. The stimulus representation stored in cortex by action of these circuits is seen as mediating three different memory processes: recognition, which occurs when the stored representation is reactivated via the original sensory pathway; recall, when it is reactivated via any other pathway; and association, when it activates other stored representations (sensory, affective, spatial, motor) via the outputs of the higher-order sensory areas to the relevant structures.


2004 ◽  
Vol 28 (3) ◽  
pp. 682-703 ◽  
Author(s):  
Fred Eckman

This paper considers the question of explanation in second language acquisition within the context of two approaches to universals, Universal Grammar and language typology. After briefly discussing the logic of explaining facts by including them under general laws (Hempel & Oppenheim 1948), the paper makes a case for the typological approach to explanation being the more fruitful, in that it allows more readily for the possibility of ‘explanatory ascent’, the ability to propose more general, higher order explanations by having lower-level generalizations follow from more general principles. The UG approach, on the other hand is less capable of such explanatory ascent because of the postulation that the innate, domain-specific principles of UG are not reducible in any interesting way to higher order principles of cognition (Chomsky 1982).


2017 ◽  
Vol 13 (S337) ◽  
pp. 251-254
Author(s):  
A. Ridolfi ◽  
P. C. C. Freire ◽  
M. Kramer ◽  
C. G. Bassa ◽  
F. Camilo ◽  
...  

AbstractMulti-decade observing campaigns of the globular clusters 47 Tucanae and M15 have led to an outstanding number of discoveries. Here, we report on the latest results of the long-term observations of the pulsars in these two clusters. For most of the pulsars in 47 Tucanae we have measured, among other things, their higher-order spin period derivatives, which have in turn provided stringent constraints on the physical parameters of the cluster, such as its distance and gravitational potential. For M15, we have studied the relativistic spin precession effect in PSR B2127+11C. We have used full-Stokes observations to model the precession effect, and to constrain the system geometry. We find that the visible beam of the pulsar is swiftly moving away from our line of sight and may very soon become undetectable. On the other hand, we expect to see the opposite emission beam sometime between 2041 and 2053.


2018 ◽  
Vol 4 (2) ◽  
pp. 231-252
Author(s):  
Marjoleine Sloos ◽  
Wang Lei

Abstract Believed dialect influences speech perception by linguistically naïve speakers. How much accent-induced bias affects perception of linguistically trained speakers is still unclear. This study experimentally investigates the influence of believed dialect on plosive perception by subjects who were phonetically and phonologically trained. Identical syllables were presented twice to each subject. In one session, the subjects were informed that the variety was a Mandarin dialect which has voiceless unaspirated and aspirated voiceless stops; and in the other session that it was a Wu dialect, which has voiceless unaspirated, voiceless aspirated, and breathy stops. More breathy stops were reported if Wu was the believed dialect. Plosive phonation in Wu is related to lexical tone, and we show that lexical tone causes another bias to plosive perception. This suggests that linguistically trained transcribers are susceptible to higher order linguistic knowledge and it demonstrates the difficulty of avoiding biased perception when the coder forms a belief about the variety that he/she transcribes. We also advocate speech perception models which include a component that accounts for the role of expected sounds.


Sign in / Sign up

Export Citation Format

Share Document