-
A note on the asymptotic expressiveness of ZF and ZFC
Authors:
Maciej Bendkowski
Abstract:
We investigate the asymptotic densities of theorems provable in Zermelo-Fraenkel set theory ZF and its extension ZFC including the axiom of choice. Assuming a canonical De Bruijn representation of formulae, we construct asymptotically large sets of sentences unprovable within ZF, yet provable in ZFC. Furthermore, we link the asymptotic density of ZFC theorems with the provable consistency of ZFC i…
▽ More
We investigate the asymptotic densities of theorems provable in Zermelo-Fraenkel set theory ZF and its extension ZFC including the axiom of choice. Assuming a canonical De Bruijn representation of formulae, we construct asymptotically large sets of sentences unprovable within ZF, yet provable in ZFC. Furthermore, we link the asymptotic density of ZFC theorems with the provable consistency of ZFC itself. Consequently, if ZFC is consistent, it is not possible to refute the existence of the asymptotic density of ZFC theorems within ZFC. Both these results address a recent question by Zaionc regarding the asymptotic equivalence of ZF and ZFC.
△ Less
Submitted 23 January, 2021; v1 submitted 20 October, 2020;
originally announced October 2020.
-
How to generate random lambda terms?
Authors:
Maciej Bendkowski
Abstract:
We survey several methods of generating large random lambda-terms, focusing on their closed and simply-typed variants. We discuss methods of exact- and approximate-size generation, as well as methods of achieving size-uniform and non-uniform outcome distributions.
We survey several methods of generating large random lambda-terms, focusing on their closed and simply-typed variants. We discuss methods of exact- and approximate-size generation, as well as methods of achieving size-uniform and non-uniform outcome distributions.
△ Less
Submitted 19 May, 2020; v1 submitted 18 May, 2020;
originally announced May 2020.
-
Tuning as convex optimisation: a polynomial tuner for multi-parametric combinatorial samplers
Authors:
Maciej Bendkowski,
Olivier Bodini,
Sergey Dovgal
Abstract:
Combinatorial samplers are algorithmic schemes devised for the approximate- and exact-size generation of large random combinatorial structures, such as context-free words, various tree-like data structures, maps, tilings, RNA molecules. They can be adapted to combinatorial specifications with additional parameters, allowing for a more flexible control over the output profile of parametrised combin…
▽ More
Combinatorial samplers are algorithmic schemes devised for the approximate- and exact-size generation of large random combinatorial structures, such as context-free words, various tree-like data structures, maps, tilings, RNA molecules. They can be adapted to combinatorial specifications with additional parameters, allowing for a more flexible control over the output profile of parametrised combinatorial patterns. One can control, for instance, the number of leaves, profile of node degrees in trees or the number of certain sub-patterns in generated strings. However, such a flexible control requires an additional and nontrivial tuning procedure.
Using techniques of convex optimisation, we present an efficient tuning algorithm for multi-parametric combinatorial specifications. Our algorithm works in polynomial time in the system description length, the number of tuning parameters, the number of combinatorial classes in the specification, and the logarithm of the total target size. We demonstrate the effectiveness of our method on a series of practical examples, including rational, algebraic, and so-called Pólya specifications. We show how our method can be adapted to a broad range of less typical combinatorial constructions, including symmetric polynomials, labelled sets and cycles with cardinality lower bounds, simple increasing trees or substitutions. Finally, we discuss some practical aspects of our prototype tuner implementation and provide its benchmark results.
△ Less
Submitted 18 August, 2021; v1 submitted 26 February, 2020;
originally announced February 2020.
-
Towards the average-case analysis of substitution resolution in $λ$-calculus
Authors:
Maciej Bendkowski
Abstract:
Substitution resolution supports the computational character of $β$-reduction, complementing its execution with a capture-avoiding exchange of terms for bound variables. Alas, the meta-level definition of substitution, masking a non-trivial computation, turns $β$-reduction into an atomic rewriting rule, despite its varying operational complexity. In the current paper we propose a somewhat indirect…
▽ More
Substitution resolution supports the computational character of $β$-reduction, complementing its execution with a capture-avoiding exchange of terms for bound variables. Alas, the meta-level definition of substitution, masking a non-trivial computation, turns $β$-reduction into an atomic rewriting rule, despite its varying operational complexity. In the current paper we propose a somewhat indirect average-case analysis of substitution resolution in the classic $λ$-calculus, based on the quantitative analysis of substitution in $λ\upsilon$, an extension of $λ$-calculus internalising the $\upsilon$-calculus of explicit substitutions. Within this framework, we show that for any fixed $n \geq 0$, the probability that a uniformly random, conditioned on size, $λ\upsilon$-term $\upsilon$-normalises in $n$ normal-order (i.e. leftmost-outermost) reduction steps tends to a computable limit as the term size tends to infinity. For that purpose, we establish an effective hierarchy $\left(\mathscr{G}_n\right)_n$ of regular tree grammars partitioning $\upsilon$-normalisable terms into classes of terms normalising in $n$ normal-order rewriting steps. The main technical ingredient in our construction is an inductive approach to the construction of $\mathscr{G}_{n+1}$ out of $\mathscr{G}_n$ based, in turn, on the algorithmic construction of finite intersection partitions, inspired by Robinson's unification algorithm. Finally, we briefly discuss applications of our approach to other term rewriting systems, focusing on two closely related formalisms, i.e. the full $λ\upsilon$-calculus and combinatory logic.
△ Less
Submitted 11 December, 2018;
originally announced December 2018.
-
Statistical properties of lambda terms
Authors:
Maciej Bendkowski,
Olivier Bodini,
Sergey Dovgal
Abstract:
We present a quantitative, statistical analysis of random lambda terms in the de Bruijn notation. Following an analytic approach using multivariate generating functions, we investigate the distribution of various combinatorial parameters of random open and closed lambda terms, including the number of redexes, head abstractions, free variables or the de Bruijn index value profile. Moreover, we cond…
▽ More
We present a quantitative, statistical analysis of random lambda terms in the de Bruijn notation. Following an analytic approach using multivariate generating functions, we investigate the distribution of various combinatorial parameters of random open and closed lambda terms, including the number of redexes, head abstractions, free variables or the de Bruijn index value profile. Moreover, we conduct an average-case complexity analysis of finding the leftmost-outermost redex in random lambda terms showing that it is on average constant. The main technical ingredient of our analysis is a novel method of dealing with combinatorial parameters inside certain infinite, algebraic systems of multivariate generating functions. Finally, we briefly discuss the random generation of lambda terms following a given skewed parameter distribution and provide empirical results regarding a series of more involved combinatorial parameters such as the number of open subterms and binding abstractions in closed lambda terms.
△ Less
Submitted 14 August, 2018; v1 submitted 23 May, 2018;
originally announced May 2018.
-
Combinatorics of explicit substitutions
Authors:
Maciej Bendkowski,
Pierre Lescanne
Abstract:
$λ\upsilon$ is an extension of the $λ$-calculus which internalises the calculus of substitutions. In the current paper, we investigate the combinatorial properties of $λ\upsilon$ focusing on the quantitative aspects of substitution resolution. We exhibit an unexpected correspondence between the counting sequence for $λ\upsilon…
▽ More
$λ\upsilon$ is an extension of the $λ$-calculus which internalises the calculus of substitutions. In the current paper, we investigate the combinatorial properties of $λ\upsilon$ focusing on the quantitative aspects of substitution resolution. We exhibit an unexpected correspondence between the counting sequence for $λ\upsilon$-terms and famous Catalan numbers. As a by-product, we establish effective sampling schemes for random $λ\upsilon$-terms. We show that typical $λ\upsilon$-terms represent, in a strong sense, non-strict computations in the classic $λ$-calculus. Moreover, typically almost all substitutions are in fact suspended, i.e. unevaluated, under closures. Consequently, we argue that $λ\upsilon$ is an intrinsically non-strict calculus of explicit substitutions. Finally, we investigate the distribution of various redexes governing the substitution resolution in $λ\upsilon$ and investigate the quantitative contribution of various substitution primitives.
△ Less
Submitted 11 April, 2018;
originally announced April 2018.
-
On the enumeration of closures and environments with an application to random generation
Authors:
Maciej Bendkowski,
Pierre Lescanne
Abstract:
Environments and closures are two of the main ingredients of evaluation in lambda-calculus. A closure is a pair consisting of a lambda-term and an environment, whereas an environment is a list of lambda-terms assigned to free variables. In this paper we investigate some dynamic aspects of evaluation in lambda-calculus considering the quantitative, combinatorial properties of environments and closu…
▽ More
Environments and closures are two of the main ingredients of evaluation in lambda-calculus. A closure is a pair consisting of a lambda-term and an environment, whereas an environment is a list of lambda-terms assigned to free variables. In this paper we investigate some dynamic aspects of evaluation in lambda-calculus considering the quantitative, combinatorial properties of environments and closures. Focusing on two classes of environments and closures, namely the so-called plain and closed ones, we consider the problem of their asymptotic counting and effective random generation. We provide an asymptotic approximation of the number of both plain environments and closures of size $n$. Using the associated generating functions, we construct effective samplers for both classes of combinatorial structures. Finally, we discuss the related problem of asymptotic counting and random generation of closed environemnts and closures.
△ Less
Submitted 16 October, 2019; v1 submitted 2 February, 2018;
originally announced February 2018.
-
Polynomial tuning of multiparametric combinatorial samplers
Authors:
Maciej Bendkowski,
Olivier Bodini,
Sergey Dovgal
Abstract:
Boltzmann samplers and the recursive method are prominent algorithmic frameworks for the approximate-size and exact-size random generation of large combinatorial structures, such as maps, tilings, RNA sequences or various tree-like structures. In their multiparametric variants, these samplers allow to control the profile of expected values corresponding to multiple combinatorial parameters. One ca…
▽ More
Boltzmann samplers and the recursive method are prominent algorithmic frameworks for the approximate-size and exact-size random generation of large combinatorial structures, such as maps, tilings, RNA sequences or various tree-like structures. In their multiparametric variants, these samplers allow to control the profile of expected values corresponding to multiple combinatorial parameters. One can control, for instance, the number of leaves, profile of node degrees in trees or the number of certain subpatterns in strings. However, such a flexible control requires an additional non-trivial tuning procedure. In this paper, we propose an efficient polynomial-time, with respect to the number of tuned parameters, tuning algorithm based on convex optimisation techniques. Finally, we illustrate the efficiency of our approach using several applications of rational, algebraic and Pólya structures including polyomino tilings with prescribed tile frequencies, planar trees with a given specific node degree distribution, and weighted partitions.
△ Less
Submitted 29 October, 2017; v1 submitted 3 August, 2017;
originally announced August 2017.
-
Combinatorics of $λ$-terms: a natural approach
Authors:
Maciej Bendkowski,
Katarzyna Grygiel,
Pierre Lescanne,
Marek Zaionc
Abstract:
We consider combinatorial aspects of $λ$-terms in the model based on de Bruijn indices where each building constructor is of size one. Surprisingly, the counting sequence for $λ$-terms corresponds also to two families of binary trees, namely black-white trees and zigzag-free ones. We provide a constructive proof of this fact by exhibiting appropriate bijections. Moreover, we identify the sequence…
▽ More
We consider combinatorial aspects of $λ$-terms in the model based on de Bruijn indices where each building constructor is of size one. Surprisingly, the counting sequence for $λ$-terms corresponds also to two families of binary trees, namely black-white trees and zigzag-free ones. We provide a constructive proof of this fact by exhibiting appropriate bijections. Moreover, we identify the sequence of Motzkin numbers with the counting sequence for neutral $λ$-terms, giving a bijection which, in consequence, results in an exact-size sampler for the latter based on the exact-size sampler for Motzkin trees of Bodini et alli. Using the powerful theory of analytic combinatorics, we state several results concerning the asymptotic growth rate of $λ$-terms in neutral, normal, and head normal forms. Finally, we investigate the asymptotic density of $λ$-terms containing arbitrary fixed subterms showing that, inter alia, strongly normalising or typeable terms are asymptotically negligible in the set of all $λ$-terms.
△ Less
Submitted 14 October, 2016; v1 submitted 24 September, 2016;
originally announced September 2016.
-
A natural counting of lambda terms
Authors:
Maciej Bendkowski,
Katarzyna Grygiel,
Pierre Lescanne,
Marek Zaionc
Abstract:
We study the sequences of numbers corresponding to lambda terms of given sizes, where the size is this of lambda terms with de Bruijn indices in a very natural model where all the operators have size 1. For plain lambda terms, the sequence corresponds to two families of binary trees for which we exhibit bijections. We study also the distribution of normal forms, head normal forms and strongly norm…
▽ More
We study the sequences of numbers corresponding to lambda terms of given sizes, where the size is this of lambda terms with de Bruijn indices in a very natural model where all the operators have size 1. For plain lambda terms, the sequence corresponds to two families of binary trees for which we exhibit bijections. We study also the distribution of normal forms, head normal forms and strongly normalizing terms. In particular we show that strongly normalizing terms are of density 0 among plain terms.
△ Less
Submitted 17 May, 2016; v1 submitted 8 June, 2015;
originally announced June 2015.