We show that a minimal subset of Java 8 excluding classes supports a simple and natural programming style, which we call lambda-based object-oriented programming. That is, on one hand the programmer can use tuples in place of objects (class instances), and tuples can be desugared to lambdas following their classical encoding in the...
-
2021 (v1)PublicationUploaded on: April 14, 2023
-
2020 (v1)Publication
We describe an inductive abstract semantics for coFJ, a Java-like calculus where, when the same method call is encountered twice, non-termination is avoided, and the programmer can decide the behaviour in this case, by writing a codefinition. The proposed semantics is abstract in the sense that evaluation is non-deterministic, and objects are...
Uploaded on: April 14, 2023 -
2019 (v1)Publication
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...
Uploaded on: April 14, 2023 -
2022 (v1)Publication
In recent work, non-regular streams have been defined corecursively, by representing them with finitary equational systems built on top of various operators, besides the standard constructor. With finitary equational systems based only on the stream constructor, one can use the free theory of regular (a.k.a. rational) trees to get a sound and...
Uploaded on: April 14, 2023 -
2021 (v1)Publication
We provide an Agda library for inference systems, also supporting their recent generalization allowing flexible coinduction, that is, interpretations which are neither inductive, nor purely coinductive. A specific inference system can be obtained as an instance by writing a set of meta-rules, in an Agda format which closely resembles the usual...
Uploaded on: April 14, 2023 -
2022 (v1)Publication
We propose a novel approach to stream definition and manipulation. Our solution is based on two key ideas. Regular corecursion, which avoids non termination by detecting cyclic calls, is enhanced, by allowing in equations defining streams other operators besides the stream constructor. In this way, some non-regular streams are definable....
Uploaded on: February 22, 2023 -
2023 (v1)Publication
Checked corecursive streams are a novel approach to stream definitions relying on a semantics of function application detecting cyclic calls, and a well-definedness check ensuring that access to an arbitrary index will always return a result. We extend the technique beyond the simple stream operators considered in previous work, notably by...
Uploaded on: January 27, 2024 -
2020 (v1)Publication
Recursive definitions of predicates are usually interpreted either inductively or coinductively. Recently, a more powerful approach has been proposed, called flexible coinduction, to express a variety of intermediate interpretations, necessary in some cases to get the correct meaning. We provide a detailed formal account of an extension of...
Uploaded on: April 14, 2023 -
2019 (v1)Publication
We describe a Java-like calculus which supports cyclic data structures, and offers a mechanism of flexible regular corecursion for their manipulation. The calculus enhances an earlier proposal by a more sophisticated reduction semantics, which filters out, by an additional check, some spurious results which were obtained in the previous model.
Uploaded on: April 14, 2023 -
2019 (v1)Publication
We present an imperative object calculus where types are annotated with qualifiers for aliasing and mutation control. There are two key novelties with respect to similar proposals. First, the type system is very expressive. Notably, it adopts the recovery approach, that is, using the type context to justify strengthening types, greatly...
Uploaded on: April 14, 2023 -
2020 (v1)Publication
We provide a construction that, given a big-step semantics describing finite computations and their observations, extends it to include infinite computations as well. The basic idea is that the finite behavior uniquely determines the infinite behavior once observations and their composition operators are fixed. Technically, the construction...
Uploaded on: March 27, 2023 -
2019 (v1)Publication
We introduce a type and effect system, for an imperative object calculus, which infers sharing possibly introduced by the evaluation of an expression, represented as an equivalence relation among its free variables. This direct representation of sharing effects at the syntactic level allows us to express in a natural way, and to generalize,...
Uploaded on: April 14, 2023 -
2023 (v1)Publication
We extend the semantics and type system of a lambda calculus equipped with common constructs to be resource-aware. That is, reduction is instrumented to keep track of the usage of resources, and the type system guarantees, besides standard soundness, that for well-typed programs there is a computation where no needed resource gets exhausted....
Uploaded on: February 4, 2024 -
2020 (v1)Publication
We propose a general proof technique to show that a predicate is sound, that is, prevents stuck computation, with respect to a big-step semantics. This result may look surprising, since in big-step semantics there is no difference between non-terminating and stuck computations, hence soundness cannot even be expressed. The key idea is to define...
Uploaded on: April 14, 2023