{'fraction_non_alphanumeric': 0.016867469879518072, 'fraction_numerical': 0.0, 'mean_word_length': 5.7560975609756095, '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}}
Towards a Safe Partial Evaluation of Lazy Functional Logic Programs

Partial Evaluation is a well-known technique for specializing programs w.r.t. a given restriction of their input data. Although partial evaluation has been widely investigated in the context of functional and functional logic languages like Haskell or Curry, current schemes are either overly restrictive or destroy sharing through the specialization process, which may produce incorrect specializations when non-deterministic functions are considered. In this work, we present a new partial evaluation scheme for lazy functional logic programs that preserves sharing through the specialization process and still allows the unfolding of arbitrary functions. Furthermore, our approach ensures that sharing is also preserved across non-deterministic computations.