# Exploiting Term Hiding to Reduce Run-time Checking Overhead

**Authors:** Nataliia Stulova, Jos\'e F. Morales, Manuel V. Hermenegildo

arXiv: 1705.06662 · 2017-10-17

## TL;DR

This paper introduces a technique that exploits term hiding in module systems to significantly reduce run-time checking overhead in untyped languages, especially for reusable libraries, without altering language semantics.

## Contribution

It proposes a novel method leveraging module-based term hiding to enhance static inference and reduce run-time check overhead in untyped languages, applicable to reusable libraries.

## Key findings

- Achieves large reductions in run-time check overhead
- Enriches shape information for reusable libraries
- Maintains full expressiveness of assertion language

## Abstract

One of the most attractive features of untyped languages is the flexibility in term creation and manipulation. However, with such power comes the responsibility of ensuring the correctness of these operations. A solution is adding run-time checks to the program via assertions, but this can introduce overheads that are in many cases impractical. While static analysis can greatly reduce such overheads, the gains depend strongly on the quality of the information inferred. Reusable libraries, i.e., library modules that are pre-compiled independently of the client, pose special challenges in this context. We propose a technique which takes advantage of module systems which can hide a selected set of functor symbols to significantly enrich the shape information that can be inferred for reusable libraries, as well as an improved run-time checking approach that leverages the proposed mechanisms to achieve large reductions in overhead, closer to those of static languages, even in the reusable-library context. While the approach is general and system-independent, we present it for concreteness in the context of the Ciao assertion language and combined static/dynamic checking framework. Our method maintains the full expressiveness of the assertion language in this context. In contrast to other approaches it does not introduce the need to switch the language to a (static) type system, which is known to change the semantics in languages like Prolog. We also study the approach experimentally and evaluate the overhead reduction achieved in the run-time checks.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1705.06662/full.md

## Figures

21 figures with captions in the complete paper: https://tomesphere.com/paper/1705.06662/full.md

## References

33 references — full list in the complete paper: https://tomesphere.com/paper/1705.06662/full.md

---
Source: https://tomesphere.com/paper/1705.06662