{'fraction_non_alphanumeric': 0.018151815181518153, 'fraction_numerical': 0.0, 'mean_word_length': 5.738888888888889, '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}}
Semiring-based Fuzzy Constraints in Concurrent Constraint Programming

Several real-life problems have been successfully modeled and solved by using constraint programming (CP). Nevertheless, existing classical (hard) constraints can not express preferences, priorities or other soft criteria in a natural way. Since these criteria often occur in many scenarios, finding techniques and tools for appropriately including them in constraint programs is crucial. This paper describes an implementation of a soft constraints module for Mozart, a concurrent constraint programming language. The module, based on the semiring formalism for soft constraints, provides an intuitive set of constraints for solving fuzzy constraint satisfaction problems and is fully orthogonal to Mozart’s implementation. We modify the concept of constraint proposed in the semiring formalism in order to define a more intuitive notion. The new concept provides straightforward user control and is suitable for efficient implementation. We present a set of intuitive examples showing the advantages of our module in different contexts. Some issues regarding the integration of soft constraints in existing applications are also discussed.