{'fraction_non_alphanumeric': 0.019364833462432222, 'fraction_numerical': 0.001549186676994578, 'mean_word_length': 5.591836734693878, '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}}
Higher-order logic programming: an expressive language for representing qualitative preferences

We consider the problem of concisely representing and handling preferences in logic programming and relational databases. Our starting point is a well-known proposal [8] which advocates the embedding of first-order preference formulas into relational algebra through a single winnow operator that is parameterized by a database relation and a preference formula. We argue that despite its elegance, the framework of [8] has a number of shortcomings: only intrinsic preference formulas are supported, the preference relations and preference queries are expressed in two different languages, and there is no direct way to define alternative operators beyond winnow. We propose the use of higher-order logic programming as a logical framework that remedies all the above deficiencies. In particular, the proposed framework supports both intrinsic and extrinsic preference formulas, it can represent both preference relations as-well-as queries, and it can be used to define a variety of interesting alternative operators beyond winnow. We demonstrate the feasibility of our approach by presenting an implementation of all the proposed concepts in the higher-order logic programming language Hilog.