Checking modes of HAL programs
Maria Garcia de la Banda, Warwick Harvey, Kim Marriott, Peter J., Stuckey, Bart Demoen

TL;DR
This paper addresses the challenge of mode checking in strongly typed constraint logic programming languages like HAL, proposing methods to handle literal reordering and polymorphic modes for improved compile-time error detection and code efficiency.
Contribution
It introduces a new approach for mode checking in HAL that manages literal reordering and polymorphic modes, enhancing compile-time analysis.
Findings
Mode checking in HAL requires reordering literals in predicate definitions.
Handling polymorphic modes can be achieved using polymorphic types.
The proposed method improves error detection and code optimization.
Abstract
Recent constraint logic programming (CLP) languages, such as HAL and Mercury, require type, mode and determinism declarations for predicates. This information allows the generation of efficient target code and the detection of many errors at compile-time. Unfortunately, mode checking in such languages is difficult. One of the main reasons is that, for each predicate mode declaration, the compiler is required to appropriately re-order literals in the predicate's definition. The task is further complicated by the need to handle complex instantiations (which interact with type declarations and higher-order predicates) and automatic initialization of solver variables. Here we define mode checking for strongly typed CLP languages which require reordering of clause body literals. In addition, we show how to handle a simple case of polymorphic modes by using the corresponding polymorphic types.
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 · Logic, Reasoning, and Knowledge · Natural Language Processing Techniques
