
TL;DR
This paper presents a bijective encoding and decoding scheme for Prolog terms into natural numbers, ensuring validity, efficiency, and minimal size overhead, with practical algorithms and a Prolog implementation.
Contribution
It introduces a novel bijective encoding for Prolog terms that guarantees validity, efficiency, and minimal size overhead, along with algorithms to separate structure and content.
Findings
Encoding is bijective and always decodes to valid terms
Encoding and decoding operate in low polynomial time
Bit size of encodings is within a constant factor of the original representation
Abstract
We encode/decode Prolog terms as unique natural numbers. Our encodings have the following properties: a) are bijective b) natural numbers always decode to syntactically valid terms c) they work in low polynomial time in the bitsize of the representations d) the bitsize of our encodings is within constant factor of the syntactic representation of the input. We describe encodings of term algebras with finite signature as well as algorithms that separate the "structure" of a term, a natural number encoding of a list of balanced parenthesis, from its "content", a list of atomic terms and Prolog variables. The paper is organized as a literate Prolog program available from \url{http://logic.cse.unt.edu/tarau/research/2011/bijenc.pl}.
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
TopicsLogic, programming, and type systems · Formal Methods in Verification · semigroups and automata theory
