{'fraction_non_alphanumeric': 0.018201284796573874, 'fraction_numerical': 0.0, 'mean_word_length': 5.071428571428571, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Lazy and Faithful Assertions for Functional Logic Programs

Assertions or contracts are an important technique to improve the quality of software. Thus, assertions are also desirable for functional logic programming. Unfortunately, there is no established meaning of assertions in languages with a demand-driven evaluation strategy. Strict assertions are immediately checked but may influence the behavior of programs. Lazy assertions do not modify the behavior but may not be faithful since some assertions might not be checked at all. This paper proposes an intermediate approach where the user can choose between lazy or faithful assertions. In order to avoid disadvantages of faithful assertions, we propose to delay them until an explicit point where faith is required, e.g., at the end of the program execution or before I/O actions. We describe a prototypical implementation of this idea in the functional logic language Curry.