Converting Combinatory Logic to and from Concatenative Calculus

Combinatory logic and its combinators BCKWI are a foundation for tacit (point-free) programming. But what does each letter mean? Informally, B stands for composing, C for swapping, K for discarding, W for duplicating and I is the identity function. However, B does more than that: depending on where it appears in the expression, it can also call functions or defer values for later. To help tell these purposes apart, we relate combinatory logic to the concatenative calculus of Kerby, which features separate primitives for the different facets of B. We provide translations from combinatory logic to concatenative calculus and vice versa. In both directions we have contributions. From concatenative to combinatory, we show that first-order stack programs map to regular combinators, and which patterns of combinators higher-order stack programs map to. From combinatory to concatenative, we extend an algorithm of Kerby to make it compatible with a call-by-value evaluation order, in addition to call-by-name. To enforce a strong association between the two worlds, our translations are simulations. That is, one evaluation step in the original program is simulated by zero or more evaluations steps in the translated program.

Authors

Institutions

Publication Details

Published
2024-09-30
DOI
https://doi.org/10.5753/sblp.2024.3460
Primary Topic
Logic, Reasoning, and Knowledge
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Converting Combinatory Logic to and from Concatenative Calculus

Diego Andrade, Hugo Musso Gualandi
Logic, Reasoning, and Knowledge
article

Converting Combinatory Logic to and from Concatenative Calculus

Diego Andrade, Hugo Musso Gualandi
article en

Abstract

Combinatory logic and its combinators BCKWI are a foundation for tacit (point-free) programming. But what does each letter mean? Informally, B stands for composing, C for swapping, K for discarding, W for duplicating and I is the identity function. However, B does more than that: depending on where it appears in the expression, it can also call functions or defer values for later. To help tell these purposes apart, we relate combinatory logic to the concatenative calculus of Kerby, which features separate primitives for the different facets of B. We provide translations from combinatory logic to concatenative calculus and vice versa. In both directions we have contributions. From concatenative to combinatory, we show that first-order stack programs map to regular combinators, and which patterns of combinators higher-order stack programs map to. From combinatory to concatenative, we extend an algorithm of Kerby to make it compatible with a call-by-value evaluation order, in addition to call-by-name. To enforce a strong association between the two worlds, our translations are simulations. That is, one evaluation step in the original program is simulated by zero or more evaluations steps in the translated program.

Universidade Federal do Rio de Janeiro (BR)
Coordenação de Aperfeiçoamento de Pessoal de Nível Superior, Conselho Nacional de Desenvolvimento Científico e Tecnológico
Openalex Percentile: Top 84%
Logic, Reasoning, and Knowledge
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.