Ranking and Unranking of Hereditarily Finite Functions and Permutations
Paul Tarau

TL;DR
This paper develops reversible encodings for Hereditarily Finite Functions and Permutations using Prolog, Ackerman's encoding, and Lehmer codes, enabling efficient ranking and unranking of these combinatorial objects.
Contribution
It introduces novel encoding methods for Hereditarily Finite Functions and Permutations, extending Ackerman's set encoding and utilizing Lehmer codes for permutations.
Findings
Provides executable Prolog implementations of encoding and decoding functions.
Extends Ackerman's encoding to Hereditarily Finite Functions.
Successfully ranks and unranks Hereditarily Finite Permutations.
Abstract
Prolog's ability to return multiple answers on backtracking provides an elegant mechanism to derive reversible encodings of combinatorial objects as Natural Numbers i.e. {\em ranking} and {\em unranking} functions. Starting from a generalization of Ackerman's encoding of Hereditarily Finite Sets with Urelements and a novel tupling/untupling operation, we derive encodings for Finite Functions and use them as building blocks for an executable theory of {\em Hereditarily Finite Functions}. The more difficult problem of {\em ranking} and {\em unranking} {\em Hereditarily Finite Permutations} is then tackled using Lehmer codes and factoradics. The paper is organized as a self-contained literate Prolog program available at \url{http://logic.csci.unt.edu/tarau/research/2008/pHFF.zip}
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
Topicssemigroups and automata theory · Computability, Logic, AI Algorithms · Advanced Algebra and Logic
