Extending the FSyntax/Hiord approach with imperative notation

State variables, loops, and other features of imperative programming languages can bring coding simplification for certain programming idioms that are more cumbersome to express recursively. Because of this, some logic programming systems have incorporated various imperative constructs. FSyntax is a syntactic approach to supporting functional notation in Prolog systems which is based on the use of the syntax and term expansion facilities of the language. Hiord is also a syntactic approach to supporting higher-order in Prolog, building on call/n, and adding other features such as anonymous predicates. Both are used extensively, for example, in the Ciao Prolog system. In this paper, we propose a number of imperative-style constructs based on extending FSyntax and Hiord. These extensions are designed to combine nicely with the basic functional notation and the higher-order facilities, as well as with other extensions, such as constraints. In contrast to other proposals, our approach provides a set of primitives and a higherlevel mechanism that, together, allow users to easily extend the language with features such as array notation, state variables, loops, etc. We illustrate the approach by defining a set of such features and using them to translate idiomatically in imperative style a large collection of small but interesting programs from the Euler Project, for which imperative-style implementations are available in multiple languages. We also show that the approach offers competitive performance.

Authors

Publication Details

Journal
UPM Digital Archive (Technical University of Madrid)
Published
2025-09-12
Primary Topic
Logic, programming, and type systems
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Extending the FSyntax/Hiord approach with imperative notation

Pedro López, José Francisco Morales Caballero, Manuel V. Hermenegildo, Paula Corral Rebollar
UPM Digital Archive (Technical University of Madrid)
Logic, programming, and type systems
article

Extending the FSyntax/Hiord approach with imperative notation

Pedro López, José Francisco Morales Caballero, Manuel V. Hermenegildo, Paula Corral Rebollar
article en

Abstract

State variables, loops, and other features of imperative programming languages can bring coding simplification for certain programming idioms that are more cumbersome to express recursively. Because of this, some logic programming systems have incorporated various imperative constructs. FSyntax is a syntactic approach to supporting functional notation in Prolog systems which is based on the use of the syntax and term expansion facilities of the language. Hiord is also a syntactic approach to supporting higher-order in Prolog, building on call/n, and adding other features such as anonymous predicates. Both are used extensively, for example, in the Ciao Prolog system. In this paper, we propose a number of imperative-style constructs based on extending FSyntax and Hiord. These extensions are designed to combine nicely with the basic functional notation and the higher-order facilities, as well as with other extensions, such as constraints. In contrast to other proposals, our approach provides a set of primitives and a higherlevel mechanism that, together, allow users to easily extend the language with features such as array notation, state variables, loops, etc. We illustrate the approach by defining a set of such features and using them to translate idiomatically in imperative style a large collection of small but interesting programs from the Euler Project, for which imperative-style implementations are available in multiple languages. We also show that the approach offers competitive performance.

UPM Digital Archive (Technical University of Madrid)
Openalex Percentile: Top 14%
Logic, programming, and type systems
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.

Extending the FSyntax/Hiord approach with imperative notation — Pedro López, José Francisco Morales Caballero, et al. · UPM Digital Archive (Technical University of Madrid) (2025) | TGRS Research Map | TGRS