Effectiveness of Annotation-Based Static Type Inference

08/28/2020
by   Isabel Wingen, et al.
0

Benefits of static type systems are well-known: they offer guarantees that no type error will occur during runtime and, inherently, inferred types serve as documentation on how functions are called. On the other hand, many type systems have to limit expressiveness of the language because, in general, it is undecidable whether a given program is correct regarding types. Another concern that was not addressed so far is that, for logic programming languages such as Prolog, it is impossible to distinguish between intended and unintended failure and, worse, intended and unintended success without additional annotations. In this paper, we elaborate on and discuss the aforementioned issues. As an alternative, we present a static type analysis which is based on plspec. Instead of ensuring full type-safety, we aim to statically identify type errors on a best-effort basis without limiting the expressiveness of Prolog programs. Finally, we evaluate our approach on real-world code featured in the SWI community packages and a large project implementing a model checker.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/14/2021

Data Type Inference for Logic Programming

In this paper we present a new static data type inference algorithm for ...
research
06/15/2019

Approximate Normalization for Gradual Dependent Types

Dependent types help programmers write highly reliable code. However, th...
research
10/17/2022

SA4U: Practical Static Analysis for Unit Type Error Detection

Unit type errors, where values with physical unit types (e.g., meters, h...
research
12/20/2019

QuB: A Resource Aware Functional Programming Language

Managing resources—file handles, database connections, etc.—is a hard pr...
research
07/05/2018

Gradual Liquid Type Inference

Liquid typing provides a decidable refinement inference mechanism that i...
research
01/28/2022

Large Scale Generation of Labeled Type Data for Python

Recently, dynamically typed languages, such as Python, have gained unpre...
research
08/25/2017

Learning to Blame: Localizing Novice Type Errors with Data-Driven Diagnosis

Localizing type errors is challenging in languages with global type infe...

Please sign up or login with your details

Forgot password? Click here to reset