2 research outputs found

    Normalization by Evaluation in the Delay Monad: A Case Study for Coinduction via Copatterns and Sized Types

    Get PDF
    In this paper, we present an Agda formalization of a normalizer for simply-typed lambda terms. The normalizer consists of two coinductively defined functions in the delay monad: One is a standard evaluator of lambda terms to closures, the other a type-directed reifier from values to eta-long beta-normal forms. Their composition, normalization-by-evaluation, is shown to be a total function a posteriori, using a standard logical-relations argument. The successful formalization serves as a proof-of-concept for coinductive programming and reasoning using sized types and copatterns, a new and presently experimental feature of Agda.Comment: In Proceedings MSFP 2014, arXiv:1406.153

    Extensions of Logic Programming for Preference Representation

    Get PDF
    Εξετάζουμε το πρόβλημα της αναπαράστασης προτιμήσεων με τη χρήση επεκτάσεων του λογικού προγραμματισμού. Η αποτελεσματική αναπαράσταση προτιμήσεων είναι ζωτικής σημασίας σε πολλά επιστημονικά πεδία και μπορεί να αποδειχθεί χρήσιμη σε πολλές πραγματικές εφαρμογές. Οι φορμαλισμοί αναπαράστασης προτιμήσεων στη βιβλιογραφία συνήθως εμπίπτουν σε δύο βασικές κατηγορίες: στην ποιοτική προσέγγιση (όπου οι προτιμήσεις εκφράζονται με διμερείς σχέσεις προτίμησης) και στην ποσοτική προσέγγιση (όπου οι προτιμήσεις αναπαριστώνται με τη χρήση αριθμητικών τιμών που εκφράζουν το βαθμό ενδιαφέροντος). Σε αυτή τη διατριβή, προτείνουμε δύο προσεγγίσεις για την έκφραση προτιμήσεων. Η πρώτη προσέγγιση χρησιμοποιεί μια απειρότιμη επέκταση του λογικού προγραμματισμού για την έκφραση ποσοτικών προτιμήσεων, ενώ η δεύτερη προσέγγιση χρησιμοποιεί τον λογικό προγραμματισμό υψηλής τάξης για την έκφραση ποιοτικών προτιμήσεων. Προτείνουμε τη γλώσσα προγραμματισμού PrefLog, μια επέκταση του λογικού προγραμματισμού που χρησιμοποιεί ένα άπειρο σύνολο τιμών αλήθειας για να υποστηρίξει τον ορισμό τελεστών ποσοτικής προτίμησης. Ορίζουμε το συντακτικό και τη σημασιολογία της γλώσσας και προσδιορίζουμε ένα σύνολο από ιδιότητες τις οποίες πρέπει να ικανοποιούν οι διαθέσιμοι τελεστές προτίμησης έτσι ώστε η γλώσσα να έχει καλώς ορισμένη σημασιολογία. Επιπλέον, προτείνουμε μία «από-κάτω-προς-τα-πάνω» τεχνική υλοποίησης για ένα καλώς ορισμένο υποσύνολο της PrefLog που αντιστοιχεί στο προτιμησιακό αντίστοιχο της γλώσσας Datalog. Η εξασφάλιση της ιδιότητας του τερματισμού μιας τέτοιας στρατηγικής δεν είναι προφανής γιατί το σύνολο των τιμών αληθείας και το σύνολο των πιθανών ερμηνειών για τέτοια προγράμματα είναι και τα δύο άπειρα. Προτείνουμε τη χρήση του λογικού προγραμματισμού υψηλής τάξης για την αναπαράσταση ποιοτικών προτιμήσεων. Σε αυτήν την προσέγγιση, σχέσεις, προτιμήσεις μεταξύ πλειάδων, προτιμήσεις μεταξύ συνόλων από πλειάδες και υπολογισμοί σχετικά με προτιμήσεις εκφράζονται στην ίδια γλώσσα υψηλής τάξης. Τα προγράμματα αυτά μπορούν να εκτελεστούν σε πραγματικά συστήματα λογικού προγραμματισμού υψηλής τάξης και η απόδοσή τους μπορεί να ενισχυθεί είτε με γενικές είτε με εξειδικευμένες τεχνικές βελτιστοποίησης. Ανάμεσα σε αυτές, προτείνουμε μια νέα τεχνική μετατροπής λογικών προγραμμάτων υψηλής τάξης σε κλασικά λογικά προγράμματα (πρώτης τάξης) και την εφαρμόζουμε στα προγράμματα της προσέγγισής μας. Τέλος, αποδεικνύουμε την εφαρμοσιμότητα της προσέγγισής μας παρουσιάζοντας μια υλοποίηση και μια πειραματική αξιολόγηση στη γλώσσα λογικού προγραμματισμού υψηλής τάξης HiLog.We consider the problem of preference representation using extensions of logic programming. The effective representation of preferences is crucial in many scientific disciplines and it can be proven useful in many real-world applications. Preference representation formalisms in the literature usually fall into two basic categories: in the qualitative approach (where preferences are expressed with binary preference relations) and in the quantitative approach (where preferences are represented with the use of numerical values that express the degree of interest). In this dissertation, we propose two approaches for expressing preferences. The first approach uses an infinite-valued extension of logic programming for expressing quantitative preferences, while the second approach uses higher-order logic programming for expressing qualitative preferences. We propose PrefLog, a logic programming language which uses an underlying infinite-valued truth domain in order to support quantitative preference operators. We introduce the syntax and the semantics of the language, and we study the properties of the PrefLog operators that are needed in order for programs to behave well from a semantic point of view. In addition, we introduce a terminating bottom-up evaluation method for a well-defined class of function-free PrefLog programs. Ensuring termination is not a straightforward task, because the underlying truth domain of PrefLog and the set of all possible interpretations of a function-free PrefLog program are both infinite. We propose the use of higher-order logic programming as a framework for representing qualitative preferences. In this approach, relations, preferences between tuples, preferences between sets of tuples and operations on preferences are expressed in the same, higher-order language. The programs can be evaluated by standard higher-order programming systems, and their performance can be enhanced with generic and specialized optimization techniques. Among these techniques, we propose a novel program transformation technique for translating higher-order programs into first-order ones and we use this technique for optimizing the higher-order programs of our interest. Finally, we demonstrate the feasibility of our approach by presenting an implementation and an experimental evaluation of all the proposed concepts in the higher-order logic programming language HiLog
    corecore