{'fraction_non_alphanumeric': 0.008964143426294821, 'fraction_numerical': 0.0, 'mean_word_length': 5.128048780487805, '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}}
A Generic Semantics for Constraint Functional Logic Programming

We propose an operational semantics for lazy constraint functional programs that is generic in the sense of allowing the integration of different constraint solvers into an existing kernel language in a rather clean way. The design of the semantics has been driven by two principles often contradicting each other: the need to support laziness in the constraint side, and the need to adhere to the black box principle of constraint programming as much as possible. We start by taking a previous semantics for Curry with equality and disequality constraints over Herbrand terms and showing how to decouple constraint handling from a neutral kernel semantics. Then, we define a Generic Constraint Solver Interface that allows us to add new solvers, thus showing the applicability of the method. The paper contains also discussions on the role played by the type system and on how to incorporate constraint solver cooperation in this setting.