
Curry is a successful, general-purpose, functional logic programming language that predefines a singleton type Success explicitly to support its logic component. We take the likely-controversial position that without Success Curry would be as much logic or more. We draw a short history and motivation for the existence of this type and justify why its elimination could be advantageous. Fur- thermore, we propose a new interpretation of rule application which is convenient for programming and increases the similarity between the functional component of Curry and functional programming as in Haskell. We outline some related theoretical (semantics) and practical (implementation) consequences of our pro- posal.
Graph algorithms that are based on the computation of one or more paths are often written in an implicitly non-deterministic way, which suggests that the result of the algorithm does not depend on a particular path, but any path that satisfies a given property. Such algorithms provide an additional challenge in typical implementations, because one needs to replace the non-determinism with an actual implementation. In this paper we explore the effects of using non-determinism explicitly in the functional logic programming language Curry. To that end we consider three algorithms and implement them in a prototypically non-deterministic fashion.
We present a partial evaluator for functional logic programs written in Curry. In contrast to previous approaches to the partial evaluation of functional logic programs, we take into account the features used in contemporary Curry programs, in particular, non-deterministic operations and recursive let expressions. For this purpose, we base our partial evaluator on FlatCurry, an intermediate language for the representation of Curry programs. We sketch our approach and present initial benchmarks of our implementation.
A novel argumentation semantics of defeasible logic programs (DeLP) is presented. Our goal is to build a semantics, which respects existing semantics and intuitions of “classical” logic programming. Generalized logic programs (GLP) are selected as an appropriate formalism for studying both undermining and rebutting. Our argumentation semantics is based on a notion of conflict resolution strategy (CRS), in order to achieve an extended flexibility and generality. Our argumentation semantics is defined in the frame of assumption-based framework (ABF), which enables a unified view on different non-monotonic formalisms. We present an embedding of DeLP into an instance of ABF. Consequently, argumentation semantics defined for ABF are applicable to DeLP. Finally, DeLP with CRS is embedded into GLP. This transformation enables to commute argumentation semantics of a DeLP via semantics of the corresponding GLP.
We describe the design, implementation, and empirical evaluation of some automated exercises that we are using in a lecture on Constraint Programming. Topics are propositional satisfiability, resolution, the DPLL algorithm, with extension to DPLL(T), and FD solving with arc consistency. The automation consists of a program for grading student answers, and in most cases also a program for generating random problem instances. The exercises are part of the autotool Eassessment framework. The implementation language is Haskell. You can try them at https://autotool.imn.htwk-leipzig.de/cgi-bin/Trial. cgi?lecture=199.
The CO4 language is a Haskell-like language for specifying constraint systems over structured finite domains. A CO4 constraint system is solved by an automatic transformation into a satisfiability problem in propositional logic that is handed to an external SAT solver. We investigate the problem of predicting the size of formulas produced by the CO4 compiler. The goal is to help the programmer in understanding the resource consumption of CO4 on his program. We present a basic cost model, with some experimental data, and discuss ongoing work towards static analysis. It turns out that analysis steps will use constraint systems as well.
This paper discusses the anomaly of gradually inconsistent argumentations when reasoning under uncertainty. It is argued that in several domains, uncertain knowledge modeling experts’ opinions may induce inconsistencies to a certain degree in interim and final conclusions. In order to model gradual/partial inconsistency, complex certainty factors are introduced and their serial and parallel propagation within rule-based expert systems is presented. Our complex certainty factor model, representing and propagating belief and disbelief separately, sheds light on the meaning of inconsistency degrees and their persistence within argumentations under uncertainty. For the methodology capable of this separate propagation, complex certainty factors for facts are designed as twoand for rules as four-dimensional value tuples. Requiring local consistency of knowledge, we show that only two dimensions are necessary for rules, and based on this finding, deliver a simple graphical visualization suitable for expert’s knowledge acquisition. Finally, we categorize gradual inconsistencies and discuss their handling. 1 Motivation: Rules, uncertainty handling, and inconsistency Assisting experts in their decisions and actions can be performed by modeling the environment by a knowledge base and asking for entailed consequences in form of derivations for expert’s expressed goals from the knowledge base. A widely used form of knowledge representation consists of facts (data) and if-then rules (production rules) for expert systems or rule-based systems. Efficient basic algorithms are known which act either in a forward-chaining, data-driven, bottom-up manner by applying rules from facts over derived interim results to goals (production view), or in a backward-chaining, goal-driven, top-down manner reducing derivations of goals to those of subgoals until reaching facts (goal/problem reduction). In case of certain knowledge, a goal may admit several derivations using a collection of facts and rules and it is known that only one derivation suffices to show entailment from a consistent (Horn) knowledge base. In case of uncertain knowledge, the methodology of rule-based systems, logic, and logic programming cannot be transferred in a straightforward manner. In their seminal work on modeling inexact reasoning in medicine, Shortliffe and Buchanan [11] propose the use of certainty factors (CF), real numbers between -1 and 1, for facts and rules, expressing measures of increased belief (positive CF) or disbelief (negative CF) according to acquired evidence, and describe within their MYCIN diagnosis system the propagation of certainty factors for derived interim and final conclusions/goals within a forward-chaining inference framework. Besides calculating CFs for logical expressions of rule conditions and propagating CFs in rule application (serial propagation), a new issue occurs whenever several derivations exist for the same conclusion/goal, such as for the same hypothesis in medical diagnosis. Whereas such a situation is not very interesting for certain knowledge—simply taking one of the derivations/argumentations as a proof for a goal (with certainty)—two derivations for the same hypothesis, each with an uncertain belief measure out of different pieces of evidences, are regarded to constitute a situation of incrementally acquired evidence for the same hypothesis and would lead to a stronger belief in that hypothesis (parallel propagation). This parallel propagation can not only be applied to two measures of increased beliefs and similarly to two measures of increased disbelief, but also to mixed belief situations where a measure of increased belief (positive CF) and a measure of increased disbelief (negative CF) are previously calculated for the same hypothesis or subgoal. This situation leads to a positive CF, if belief is of higher degree, to a negative CF, if disbelief is of higher degree, and to zero if measures of belief and disbelief are equal. The two versions of MYCIN formulas for parallel propagation do not apply to combine certain belief (+1) and certain disbelief (-1)—the case of absolute inconsistency. This paper recognizes a deficiency in the latter kind of calculations from a modeling point of view when reasoning with experts’ opinions and rules which could lead to (degrees of) contradictions due to (partially) inconsistent argumentations and derivations for goals and subgoals. We introduce complex certainty factors to manage these contradicting opinions leading to combined measures of increased belief and disbelief. Calculations of complex certainty factors enable to recognize conflicting subresults and propagate degrees of inconsistency until final goals and conclusions. In our opinion, the idea and visualization of the proposed complex certainty factors will throw light on the problem of gradual inconsistency within uncertainty reasoning. The author is aware that starting with works of Heckermann and Horovitz [6] and Pierce [10], in which several anomalies in “extensional approaches” like the CF model for uncertainty reasoning are discussed and in which belief networks as an “intentional approach” based on Bayesian probabilistic inference are declared to constitute a superior model for reasoning with uncertainty, a considerable part of the AI community followed this opinion including the developers of MYCIN themselves (Heckerman and Shortliffe [7]). Extensional approaches, viewed as suffering from modularity together with locality and detachment, “respond only to the magnitudes of weights and not to their origins” [10] and therefore lack a proper handling of distant correlated evidences. However, the problem of partial/gradual inconsistency addressed in this paper describes another type of anomaly of reasoning with uncertainty and we are not aware of a resolution of this anomaly in nonor quasi-probabilistic (extensional) or probabilistic (intentional) systems including belief networks. In Sect. 2, we emphasize the relevance of the inconsistency anomaly by considering some business applications where expert’s knowledge could lead to inconsistencies. In Sect. 3, we review the MYCIN certainty factor model and discuss some general interpretation issues, such as properties of degrees of confirmation and disconfirmation. We define the notion of local belief consistency and distinguish absolute and uncertain belief/disbelief as well as absolute and partial inconsistency. The anomaly of gradual inconsistency is illustrated by a fictive example of experts’ ratings of derivatives related to the financial crisis. In order to model gradual inconsistency, we introduce complex certainty factors in Sect. 4 and present their serial and parallel propagation within a rule-based expert system in Sect. 5. In order to propagate belief and disbelief separately, more complex certainty factors for rules are necessary, still under requirements of local consistency of knowledge, they could be simplified (cp. 5.3). A simple graphical visualization for expert’s knowledge acquisition follows. Detecting inconsistencies in expert’s argumentations is illustrated by applying our model to the financial crisis example in subsect. 6.1. Though our ideas to handle the anomaly of gradual inconsistency are designed using the CF model, they are applicable to other formalisms as well. Reasoning with complex certainty factors do not only sum up evaluation of a decision by a figure like certainty factor, probability or likelihood ratio, but can also evaluate distrust and skepticism (cp. 6.2) whenever different argumentations lead to partially conflicting conclusions. In 6.3, we retrospectively interpret the phenomenon of gradual inconsistency, distinguish inherent and apparent inconsistency in the course of uncertainty reasoning and show techniques to resolve recognized types of inconsistencies leading to future works (Sect. 7). 2 Expert knowledge and inconsistency in business applications Many decision problems in business, economics, society, and politics are based on predictive knowledge and expert evaluations that are prone to hidden conflicts and inconsistencies. They represent partial information on cause-effect relationships with a lack of exhaustive frequency or (a-priori and conditional) probability data being a prerequisite for building belief networks. Inference systems should be able to handle experts’ opinions as partial and modular knowledge about cause-effect, influence, and relevance relationships as well as selective association rules extracted by data mining techniques. One application domain lacking complete probability data is risk evaluation of new technologies; only (uncertain) expert opinions about causal relationships are known concerning future consequences. Examples are relationships between greenhouse effect and global warming, between environmental contamination, damage and catastrophes, as well as effects of extensive use of mobiles and social media on children’s mental growth. TV shows with debates of experts of different schools of thought often exhibit that controversial and opposite opinions may lead to inconsistencies in argumentations. Also, knowledge and rules of the same expert may sometimes induce indiscernible inconsistency within a subject. In politics, it is not rare to find “experts” who preach democracy principles and human rights but support dictatorships because of hidden economic interests. Such kind of inconsistency cannot be detected easily by TV spectators confronted with experts’ opinions on complex problems such as globalization, currency devaluation, political instability, middle-east conflict and Arab spring. Furthermore, there are some areas such as law and jurisprudence where knowledge to be applied is normative. Besides informative knowledge considered as descriptive, helping with conceptual understanding, normative knowledge is seen as prescriptive showing how to comply (with law). Normative orders and system
We present an approach to automatically generating operation invariance tests for use with Haskell’s random testing framework QuickCheck. The motivation stems from a paper by Holdermans [8] which showed how to address certain shortcomings of straightforward testing of implementations of an abstract datatype. While effective, his solution requires extra generation work from the test engineer. Also, it may not even be doable if the person responsible for testing has no knowledge about, and program-level access to, the internals of the concrete datatype implementation under test. We propose and realize a refinement to Holdermans’ solution that improves on both aspects: Required operation invariance tests can be formulated even in ignorance of implementation internals, and can be automatically generated using Template Haskell.
Currently, the extension of ontologies by a rule representation is a very popular research issue. A rule language increases the expressiveness of the underlying knowledge in many ways. Likewise, the integration creates new challenges for the design process of such ontologies, but also existing evaluation methodologies have to cope with the extension of ontologies by rules. In this work, we introduce supplements to existing verification techniques to support the design of ontologies with rule enhancements, and we focus on the detection of anomalies that can especially occur due to the combined use of rules and ontological definitions.
As a first step to combine the two programming paradigms – objectoriented programming and logic programming – we have introduced a generic default mapping for JAVA objects and PROLOG terms. This mapping can be used without any modification to the JAVA classes that stand behind the objects. We also can generate automatically JAVA classes from predicates in PROLOG that map to each other. Apart from the default mapping it is further possible to customise the mapping by JAVA annotations. This allows for different Prolog-Views on a given class in JAVA. The data exchange format between JAVA and PROLOG is a simple textual representation of the JAVA objects and of the terms in PROLOG. Because this textual representation already conforms PROLOG’s syntax, it can be directly used within PROLOG. In a second step we have to develop the link between JAVA and PROLOG that executes the mapping and communication. We already have presented a connector architecture for PROLOG and JAVA and an example interface that successfully uses our object term mapping with high performance. However, this interface depends heavily on a single PROLOG implementation: SWI-PROLOG. But as we have a generic mapping between JAVA objects and PROLOG terms, we also strive for an interface that also is generic and can be used independently of the PROLOG implementation. In this paper, we present the Portable Prolog Interface (PPI) for JAVA that uses the standard streams stdin, stdout and stderr to communicate with a PROLOG instance. Because these standard streams are available for all popular operating systems and are used by most of the PROLOG implementations for the user interaction, the PPI works for a broad range of PROLOG implementations. We evaluate our new generic interface PPI with different PROLOG engines and without changing the underlying JAVA or PROLOG source code of our tests.
The Paisley architecture is a light-weight EDSL for non-deterministic pattern matching. It automates the querying of arbitrary objectoriented data models in a general-purpose programming language, using API, libraries and simple programming patterns in a portable and noninvasive way. The core of Paisley has been applied to real-world applications. Here we discuss the extension of Paisley by pattern iteration, which adds a Kleene algebra of pattern function composition to the unrestricted use of the imperative host language, thus forming a hybrid object-oriented–functional–logic framework. We subject it to a classical practical problem and established benchmarks: the node-set fragment of the XPath language for querying W3C XML document object models.
With the introduction of Java 5.0 the type system has been extended by parameterized types, type variables, type terms, and wildcards. As a result very complex types can arise. The term $\tt{Vector}}}$ is for example a correct type in Java 5.0. In this paper we present a type unification algorithm for Java 5.0 type terms. The algorithm unifies type terms, which are in subtype relationship. For this we define Java 5.0 type terms and its subtyping relation, formally. As Java 5.0 allows wildcards as instances of generic types, the subtyping ordering contains infinite chains. We show that the type unification is still finitary. We give a type unification algorithm, which calculates the finite set of general unifiers.
Optimized task scheduling is in general an NP-hard problem, even if the tasks are prioritized like surgeries in hospitals. Better pruning algorithms for the constraints within such constraint optimization problems, in particular for the constraints representing the objectives to be optimized, will result in faster convergence of branch & bound algorithms. This paper presents new pruning rules for linear weighted (task) sums where the summands are the start times of tasks to be scheduled on an exclusively available resource and weighted by the tasks' priorities. The presented pruning rules are proven to be correct and the speed-up of the optimization is shown in comparison with well-known general-purpose pruning rules for weighted sums.
Resolution strategies based on tabling are considered to be particularly effective in Logic Programming. Unfortunately, when faced with applications that compute large and/or many answers, memory exhaustion is a potential problem. In such cases, table deletion is the most common approach to recover space. In this work, we propose a different approach, storing tables into a relational database. Subsequent calls to stored tables import answers from the database, rather than performing a complete re-computation. To validate this approach, we have extended the YapTab tabling system, providing engine support for exporting and importing tables to and from the MySQL RDBMS. Three different relational models for data storage and two recordset retrieval strategies are compared.
Constraint programming is mainly used to solve combinatorial problems such as scheduling and allocation, which are of vital importance to modern business. In this paper, we introduce the course and examination timetabling problems at the German University in Cairo. As manual generation of schedules is time-consuming and inconvenient, we show how these problems can be modeled as constraint satisfaction problems and can be solved using SICStus Prolog with its powerful constraint library.
In this paper we investigate how to integrate the XQuery language and logic programming. With this aim, we represent XML documents by means of a logic program. This logic program represents the document schema by means of rules and the document itself by means of facts. Now, XQuery expressions can be integrated into logic programming by considering a translation (i.e. encoding) of for-let-where-return expressions by means of logic rules and a goal.
In a recent work we have proposed let-rewriting, a simple one-step relation close to ordinary term rewriting but able, via local bindings, to express sharing of computed values. In this way, let-rewriting reflects the call-time choice semantics for non-determinism adopted by modern functional logic languages, where programs are rewrite systems possibly non-confluent and non-terminating. In this paper we extend that work providing a notion of let-narrowing which is adequate for call-time choice as proved by soundness and completeness results of let-narrowing with respect to let-rewriting. Completeness is based on a lifting lemma for let-rewriting similar to Hullot’s lifting lemma for ordinary rewriting and narrowing. Our work copes with first order, left linear, constructor-based rewrite systems with no other restrictions about confluence, termination or presence of extra variables in right-hand sides of rules.
The difference-list technique is an effective method for extending lists to the right without using the append/3 procedure. There exist some proposals for automatic transformation of list programs into difference-list programs. However, we are interested in a construction of difference-list programs by the programmer, avoiding the need of a transformation. In [9] it was demonstrated, how left-recursive procedures with a dangling call of append/3 can be transformed into right-recursion using the unfolding technique. For some types of right-recursive procedures, the equivalence of the accumulator technique and difference-list technique was shown and rules for writing corresponding difference-list programs were given. In the present paper, improved and simplified rules are derived which substitute the formerly given ones. We can show that these rule allow us to write difference-list programs which supply result-lists that are either constructed in top-down -manner (elements in append order) or in bottom-up manner (elements in inverse order) in a simple schematic way.
Domain knowledge is a valuable resource for improving the quality of the results of data mining methods. In this paper, we present a methodological approach for providing domain knowledge in a declarative manner : We utilize a Prolog knowledge base with facts for the specification of properties of ontological concepts and rules for the derivation of further ad-hoc relations between these concepts. This enhances the documentation , extendability , and standardization of the applied knowledge. Furthermore, the presented approach also provides for potential automatic verification and improved maintenance options with respect to the used domain knowledge.
The performance of a large biological application of relational databases highly depends on the quality of the database schema design, the resulting structure of the tables, and the logical relations between them. We have developed a tool named Squash ( Sql Query Analyzer and Schema EnHancer) for visualizing, analyzing and refactoring database applications.Squash parses the Sql definition of the data-base schema and the queries into an Xml representation called Squash ml , which is then processed in Swi --- Prolog and the integrated Xml query and transformation language Fn Query. Squash comes with a set of predefined methods for tuning the database application according to the load profile, and with methods for proposing refactorings, such as index creation, partitioning, splitting, or further normalization of the database schema. Sql statements are adapted simultaneously upon modification of the schema. Moreover, the declarative Squash framework can be flexibly extended by user---defined methods .