{'fraction_non_alphanumeric': 0.02443280977312391, 'fraction_numerical': 0.005235602094240838, 'mean_word_length': 5.6686046511627906, '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 Narrowing and Needed Narrowing : A Comparison

Functional logic programming [8] allows us to integrate some of the best features of the classical declarative paradigms, namely functional and logic programming. The operational semantics of functional logic languages is usually based on narrowing, an evaluation mechanism which combines the reduction principle of functional languages and the resolution principle of logic languages. Lazy evaluation is a valuable feature of functional (logic) programming languages since it avoids unnecessary computations and allows us to deal with infinite data structures. Recently, Antoy et al. [4] introduced a lazy evaluation strategy for functional logic programs, called needed narrowing, which generalizes Huet and Lévy’s [11] call by need reduction to deal with logical variables and unification in inductively sequential rewrite systems, where functions are defined in a way which is similar to case expressions. This paper investigates and clarifies the formal relation between needed narrowing and the (not so lazy) demand-driven narrowing strategy of [18]. We demonstrate the following results: