669 research outputs found
LiquidHaskell : Liquid Types for Haskell
Ακόμα και τα ασφαλή προγράμματα μπορούν να έχουν λάθη. Προγράμματα που έχουν
μεταγλωτιστεί με βάση κάποιο ισχυρό σύστημα τύπων, όπως αυτό της Haskell,
μπορούν να πετάξουν σφάλμα κατα τον χρόνο εκτέλεσης ή να δώσουν μη αναμενώμενη
απάντηση. Τα refinement συστήματα τύπων
αντιμετωπίζουν αυτήν την κατάσταση αφού επιτρέπουν την έκφραση σημασιολογικών
προδιαφραφών των προγραμμάτων. Αναλύουμε την απόδειξη των προδιαγραφών σε αυτά
τα συστήματα. Πολύ εκφραστικά συστήματα απαιτούν ελέγχους κατά τον χρόνο
εκτέλεσης ή ρητές αποδείξεις από τον
χρήστη, για την αποδειξη των προδιαγραφών, Λιγότερο εκφραστικά συστήματα τύπων
επιτρέπουν την αυτόματη απόδειξη των προδιαγραφών, κατά τον χρόνο μεταγλώτισης.
Παρουσιάζουμε τους liquidTypes ένα σύστημα τύπων που επιτρέπει την αυτόματη
απόδειξη προδιαγραφών κατά τον χρόνο μεταγλώτισης. Επεκτείνουμε τους
liquidTypes με abstract refinement, έναν μηχανισμό που αυξάνει την
εκφραστικότητα του συστήματος, χωρίς να αυξάνει την πολυπλοκοτητά του.
Υλοποιήσαμε την LiquidHaskell ένα σύστημα τύπων για Haskell που συνδιάζει
liquidTypes
με abstract refinement και το χρησιμοποιήσαμε για να αποδείξουμε ιδιώτητες
πραγματικων βιβλιοθηκών της Haskell.Even well-typed programs can go wrong, by returning a wrong answer or throwing
a run-time error. A
popular response is to allow programmers use refinement type systems to express
semantic specifications
about programs. We study verification in such systems. On the one hand,
expressive refinement
type systems require run-time checks or explicit proofs to verify
specifications. On the other, less expressive
type systems allow static and automatic proofs of the specifications. Next, we
present abstract
refinement types, a means to enhance the expressiveness of a refinement type
system without increasing
its complexity. Then, we present LiquidHaskell that combines liquidTypes with
abstraction over
refinements to enhance expressiveness of LiquidTypes. LiquidHaskell is a quite
expressive verification
tool for Haskell programs that can be used to check termination, totality and
general functional
correctness. Finally, we evaluate LiquidHaskell in real world Haskell
libraries
Extending Liquid Types to Arrays
A liquid type is an ordinary Hindley-Milner type annotated with a logical predicate that states the properties satisfied by the elements of that type. Liquid types are a powerful tool for program verification, since programmers can use them to specify pre- and postconditions of their programs, while the predicates of intermediate variables and auxiliary functions are inferred automatically. Type inference is feasible in this context, since the logical predicates within liquid types are constrained to a quantifier-free logic in order to maintain decidability.
In this paper we extend liquid types by allowing them to contain quantified properties on arrays, so that they can be used to infer invariants on array-related programs (for example, implementations of sorting algorithms). Although quantified logic is, in general, undecidable, we restrict properties on arrays to a decidable subset introduced by Bradley et al. We describe in detail the extended type system, the verification condition generator, and the iterative weakening algorithm for inferring invariants. After proving the correctness and completeness of these two algorithms, we apply them to find invariants on a set of algorithms involving array manipulations
The Determinants of Polish Farmers' Credit Interest Rates: Hedonic Price Analysis and Implications for Government Policy
Our micro-econometric analysis of agricultural credit market outcomes in Poland sheds new light on the relationship between contractual arrangements and interest rates. An innovative theoretical framework based on a hedonic market model is developed. We interpret the factors that influence interest rates as "quality" components of the credit contract. We use unique data including detailed information about Polish farmers' credit contracts. Both nominal interest rates and bank fees are considered. Results show that banks prefer liquid types of collateral, and care little about the loan's purpose. The effect of government subsidies on interest rates is small compared to the officially declared reduction of the nominal rate.agricultural finance, credit policy, hedonic regression, micro-econometrics, Poland, Agricultural and Food Policy, Financial Economics, Q12, Q14, P32,
Gradual Liquid Type Inference
Liquid typing provides a decidable refinement inference mechanism that is
convenient but subject to two major issues: (1) inference is global and
requires top-level annotations, making it unsuitable for inference of modular
code components and prohibiting its applicability to library code, and (2)
inference failure results in obscure error messages. These difficulties
seriously hamper the migration of existing code to use refinements. This paper
shows that gradual liquid type inference---a novel combination of liquid
inference and gradual refinement types---addresses both issues. Gradual
refinement types, which support imprecise predicates that are optimistically
interpreted, can be used in argument positions to constrain liquid inference so
that the global inference process e effectively infers modular specifications
usable for library components. Dually, when gradual refinements appear as the
result of inference, they signal an inconsistency in the use of static
refinements. Because liquid refinements are drawn from a nite set of
predicates, in gradual liquid type inference we can enumerate the safe
concretizations of each imprecise refinement, i.e. the static refinements that
justify why a program is gradually well-typed. This enumeration is useful for
static liquid type error explanation, since the safe concretizations exhibit
all the potential inconsistencies that lead to static type errors. We develop
the theory of gradual liquid type inference and explore its pragmatics in the
setting of Liquid Haskell.Comment: To appear at OOPSLA 201
Liquid Intersection Types
We present a new type system combining refinement types and the
expressiveness of intersection type discipline. The use of such features makes
it possible to derive more precise types than in the original refinement
system. We have been able to prove several interesting properties for our
system (including subject reduction) and developed an inference algorithm,
which we proved to be sound.Comment: In Proceedings ITRS 2014, arXiv:1503.0437
Higher-order Program Verification as Satisfiability Modulo Theories with Algebraic Data-types
We report on work in progress on automatic procedures for proving properties
of programs written in higher-order functional languages. Our approach encodes
higher-order programs directly as first-order SMT problems over Horn clauses.
It is straight-forward to reduce Hoare-style verification of first-order
programs into satisfiability of Horn clauses. The presence of closures offers
several challenges: relatively complete proof systems have to account for
closures; and in practice, the effectiveness of search procedures depend on
encoding strategies and capabilities of underlying solvers. We here use
algebraic data-types to encode closures and rely on solvers that support
algebraic data-types. The viability of the approach is examined using examples
from the literature on higher-order program verification
On the Concept of Variable Roles and its Use in Software Analysis
Human written source code in imperative programming languages exhibits
typical patterns for variable use such as flags, loop iterators, counters,
indices, bitvectors etc. Although it is widely understood by practitioners that
these variable roles are important for automated software analysis tools, they
are not systematically studied by the formal methods community, and not well
documented in the research literature. In this paper, we study the notion of
variable roles on the example of basic types (int, float, char) in C. We
propose a classification of the variables in a program by variable roles, and
demonstrate that classical data flow analysis lends itself naturally both as a
specification formalism and an analysis paradigm for this classification
problem. We demonstrate the practical applicability of our method by predicting
membership of source files to the different categories of the software
verification competition SVCOMP 2013
Pabble: parameterised Scribble
© 2014, The Author(s).Many parallel and distributed message-passing programs are written in a parametric way over available resources, in particular the number of nodes and their topologies, so that a single parallel program can scale over different environments. This article presents a parameterised protocol description language, Pabble, which can guarantee safety and progress in a large class of practical, complex parameterised message-passing programs through static checking. Pabble can describe an overall interaction topology, using a concise and expressive notation, designed for a variable number of participants arranged in multiple dimensions. These parameterised protocols in turn automatically generate local protocols for type checking parameterised MPI programs for communication safety and deadlock freedom. In spite of undecidability of endpoint projection and type checking in the underlying parameterised session type theory, our method guarantees the termination of end point projection and type checking
- …