10,966 research outputs found
A Case Study in Refactoring Functional Programs
Refactoring is the process of redesigning existing code without changing its functionality. Refactoring has recently come to prominence in the OO community. In this paper we explore the prospects for refactoring functional programs. Our paper centres on the case study of refactoring a 400 line Haskell program written by one of our students. The case study illustrates the type and variety of program manipulations involved in refactoring. Similarly to other program transformations, refactorings are based on program equivalences, and thus ultimately on language semantics. In the context of functional languages, refactorings can be based on existing theory and program analyses. However, the use of program transformations for program restructuring emphasises a different kind of transformation from the more traditional derivation or optimisation: characteristically, they often require wholesale changes to a collection of modules, and although they are best controlled by programmers, their application may require nontrivial semantic analyses. The paper also explores the background to refactoring, provides a taxonomy for describing refactorings and draws some conclusions about refactoring for functional programs
The CIFF Proof Procedure for Abductive Logic Programming with Constraints: Theory, Implementation and Experiments
We present the CIFF proof procedure for abductive logic programming with
constraints, and we prove its correctness. CIFF is an extension of the IFF
proof procedure for abductive logic programming, relaxing the original
restrictions over variable quantification (allowedness conditions) and
incorporating a constraint solver to deal with numerical constraints as in
constraint logic programming. Finally, we describe the CIFF system, comparing
it with state of the art abductive systems and answer set solvers and showing
how to use it to program some applications. (To appear in Theory and Practice
of Logic Programming - TPLP)
A Goal-Directed Implementation of Query Answering for Hybrid MKNF Knowledge Bases
Ontologies and rules are usually loosely coupled in knowledge representation
formalisms. In fact, ontologies use open-world reasoning while the leading
semantics for rules use non-monotonic, closed-world reasoning. One exception is
the tightly-coupled framework of Minimal Knowledge and Negation as Failure
(MKNF), which allows statements about individuals to be jointly derived via
entailment from an ontology and inferences from rules. Nonetheless, the
practical usefulness of MKNF has not always been clear, although recent work
has formalized a general resolution-based method for querying MKNF when rules
are taken to have the well-founded semantics, and the ontology is modeled by a
general oracle. That work leaves open what algorithms should be used to relate
the entailments of the ontology and the inferences of rules. In this paper we
provide such algorithms, and describe the implementation of a query-driven
system, CDF-Rules, for hybrid knowledge bases combining both (non-monotonic)
rules under the well-founded semantics and a (monotonic) ontology, represented
by a CDF Type-1 (ALQ) theory. To appear in Theory and Practice of Logic
Programming (TPLP
Hypertableau Reasoning for Description Logics
We present a novel reasoning calculus for the description logic SHOIQ^+---a
knowledge representation formalism with applications in areas such as the
Semantic Web. Unnecessary nondeterminism and the construction of large models
are two primary sources of inefficiency in the tableau-based reasoning calculi
used in state-of-the-art reasoners. In order to reduce nondeterminism, we base
our calculus on hypertableau and hyperresolution calculi, which we extend with
a blocking condition to ensure termination. In order to reduce the size of the
constructed models, we introduce anywhere pairwise blocking. We also present an
improved nominal introduction rule that ensures termination in the presence of
nominals, inverse roles, and number restrictions---a combination of DL
constructs that has proven notoriously difficult to handle. Our implementation
shows significant performance improvements over state-of-the-art reasoners on
several well-known ontologies
Refactoring Functional Programs
Refactoring is the process of redesigning existing code without changing its functionality. Refactoring has recently come to prominence in the OO community. In this paper we explore the prospects for refactoring functional programs. Our paper centres on the case study of refactoring a 400 line Haskell program written by one of our students. The case study illustrates the type and variety of program manipulations involved in refactoring. Similarly to other program transformations, refactorings are based on program equivalences, and thus ultimately on language semantics. In the context of functional languages, refactorings can be based on existing theory and program analyses. However, the use of program transformations for program restructuring emphasises a different kind of transformation from the more traditional derivation or optimisation: characteristically, they often require wholesale changes to a collection of modules, and although they are best controlled by programmers, their application may require nontrivial semantic analyses. The paper also explores the background to refactoring, provides a taxonomy for describing refactorings and draws some conclusions about refactoring for functional programs
- …