{'fraction_non_alphanumeric': 0.021479713603818614, 'fraction_numerical': 0.0, 'mean_word_length': 5.124087591240876, '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}}
Term Rewriting with Sharing and Memo

Jungle evaluation is an approach to deene term rewriting with sharing based on graph grammars. This approach preserves important properties of term rewriting like termination, and connuence for terminating systems (under mild restrictions). In this paper, term rewriting with sharing is further accelerated, by memo zation known from functional programming languages: The result of evaluating a function with some arguments is tabulated so that it can be looked up later on when the function is reapplied to the same arguments. We show that term rewriting with sharing and memo zation is correct and complete w.r.t. jungle evaluation if the rules are non-overlapping and non-looping. Redundant re-evaluation of functions is avoided, independent of a particular strategy for applying evaluation rules.