Content area

Abstract

This thesis presents the design and implementation of a dialect-agnostic Language Server for Prolog, developed to enhance the development experience across diverse Prolog dialects—specifically targeting both SICStus Prolog, a closed-source standard-compliant implementation, and SWIProlog, a widely-used open-source variant.

The server is built around a parser-based static analysis pipeline using Tree-sitter, enabling modern editor features such as go-to-definition, hover documentation, diagnostics, and semantic tokenization. A core design goal was to remain interpreter-independent while addressing the complexities of Prolog’s dynamic syntax, runtime-modifiable operator definitions, and semanticaltering directives such as. The system achieves portability and configurability by embedding metadata within the source code, adopting PlDoc as a standard documentation interface, and transforming SICStus documentation to PlDoc format for unified support.

To evaluate its effectiveness, the language server was used as a static linting engine across hundreds of student submissions. The analysis revealed common and recurring errors—such as singleton variables, undefined predicates, and directive misuses—which the server would have reported during development, potentially saving students from losing marks. Although the qualitative user study could not be carried out due to timing constraints, its structure was designed to assess the tool’s usability and value in future iterations.

Beyond its immediate functionality, the language server acts as a platform for future innovation in Prolog tooling. Through the LSP’s workspace/executeCommand interface, the system allows the seamless integration of arbitrary external tools, enabling research prototypes or new analyses to be deployed directly within developer environments. This extensibility minimizes the friction of adopting new tools, allowing them to benefit from existing infrastructure and editor integrations.

The result is a modular, reusable, and scalable foundation for enhancing the Prolog development experience. This work not only bridges a long-standing tooling gap, but also establishes a path forward for embedding research into practice and scaling Prolog support in both educational and professional contexts.

Details

1010268
Title
Development of a Language Server for Prolog
Number of pages
141
Publication year
2025
Degree date
2025
School code
5896
Source
MAI 87/5(E), Masters Abstracts International
ISBN
9798265424679
University/institution
Universidade do Porto (Portugal)
University location
Portugal
Degree
M.Eng.
Source type
Dissertation or Thesis
Language
English
Document type
Dissertation/Thesis
Dissertation/thesis number
32306515
ProQuest document ID
3275479944
Document URL
https://www.proquest.com/dissertations-theses/development-language-server-prolog/docview/3275479944/se-2?accountid=208611
Copyright
Database copyright ProQuest LLC; ProQuest does not claim copyright in the individual underlying works.
Database
ProQuest One Academic