| M. Hanus, Polymorphic higher-order programming in Prolog., Proc. 6th International Conference on Logic Programming, Lisbon, 1989, pp. 382--397. |
....situations in which success or failure in typed uni cation is not dependent on type annotations. One such situation, rst presented in [15] and labeled in [8] as type generality, e ectively amounts to banishing ad hoc polymorphism. A generalization of this criterion is also described in [9]. While identifying such criteria is useful, this does not provide a scheme for dealing with situations in which the criteria described are not met. Further, the usual criteria presented for eliding types at run time depend on a crucial property of a rst order language: types play a role in ....
....of clauses. In the rst order context, types in uence only the existence of uni ers and not their structure. It has therefore been suggested that 9 analysis of types during execution may be eliminated in situations where the question of uni ability is itself independent of type information [9]. While this is of interest as an optimization technique, this is certainly not comprehensive enough to be an implementation strategy even for the rst order case. Moreover, the underlying assumption does not generalize to other contexts of interest, such as that of a higher order language. In ....
Michael Hanus. Polymorphic higher-order programming in Prolog. In Giorgio Levi and Maurizio Martelli, editors, Proceedings of the Sixth International Logic Programming Conference, pages 382-398. MIT Press, 1989.
....Several explicitly typed semantics for logic programming have been presented [30, 34, 50] The semantics of Lakshman and Reddy [50] was also used to prove soundness of the Mycroft O Keefe type system. Several type systems have been de ned for higher order programming with parametric polymorphism [9, 10, 28, 35, 73]. Extending parametric polymorphism with subtyping in the context of logic programming was considered in [23, 65, 89, 94, 95, 110] Soft type systems for logic programming have been investigated in [15] Recent work on types for logic programming have concentrated on implementation techniques for ....
Michael Hanus. Polymorphic higher-order programming in Prolog. In G. Levi and M. Martelli, editors, Proceedings of 6th International Conference on Logic Programming, pages 382-397, 1989.
....proposed for Prolog [19] One of the main features addressed in these type systems is polymorphism and one of the main constraints is that polymorphism does not introduce dynamic typechecking. Therefore, polymorphism is restricted. The restriction we discuss here is called type preserving by Hanus [5, 6] or transparency property by Hill and Topor [8] Hanus showed that this restriction is not compatible with higher order programming. Because we have the Prologlanguage in mind, for which higher order programming is a standard technique, we cannot keep this restriction. Hanus showed that some ....
....left side: the declarations for constants cons and nil can be written in ML as datatype a list = nil cons of a a list 4 This ensures that well typed programs cannot go wrong [15] This restriction makes it always possible to derive the type of subterms from the type of a term. Hanus [6] showed that this type preserving restriction, coupled with definitional genericity, is not compatible with higher order programming. Consider the map predicate: map : pred(T1, T2) list(T1) list(T2) o. map(P, map(P, A L] PA, PL] apply(P, A, PA) map(P, L, PL) The ....
[Article contains additional citation context not shown here]
M. Hanus. Polymorphic higher-order programming in Prolog. In G. Levi and M. Martelli, editors, 6th Int. Conf. Logic Programming, pages 382-- 397. MIT Press, 1989. 13
.... can be replaced by a predicate term, here inv(p) through q(X; Y ) inv(p) X; Y ) In a metalogic programming framework the operator inv may be re expressed through an ordinary definite clause apply(inv(P ) X;Y ) apply(P; Y; X) appealing to the technique originating in [23] see also [14]. Here program predicates are represented as terms via appeals to general predicates apply expressing application of a predicate to its arguments defined by clauses apply(p; X 1 ; X n ) p(X 1 ; X n ) for the relevant predicates. Generalizing from the above sample operator the ....
....tuples, together with list construction destruction. The theorem may be conceived as a combinatorial completeness theorem for the applied combinators relative to definite clauses. 9 Towards Higher Order Combinators The introduced combinators may be conceived as higher order predicates cf. e.g. [9, 14, 24] in the context of a relational form of logical type theory, see e.g. 5] 19 Consider as example the conjunction operator as defined above with denotations being subsets of the n fold Cartesian product of the Herbrand universe: and( 2 fht 1 ; t n i 2 H n g ....
M. Hanus, Polymorphic Higher-Order Programming in Prolog. In G. Levi and M. Martelli, eds., Procs. Sixth International Conference on Logic Programming, (MIT Press, London, 1987) 382--397.
....problems, in which unapplied and partially applied functions are represented by constructors and implicit higher order applications are made into explicit first order applications. This idea dates back to Warren [13] for logic programs and to Reynolds [11] for functional programs. Hanus [7, 8] shows how this idea works for dynamically typed languages. Gonzalez Moreno [5] adapts the same idea to untyped narrowing. Our contribution is to define this transformation for statically typed source and target languages. We give a rigorous presentation for monomorphic programs and sketch an ....
.... system using explicit type annotations on all terms together with runtime type unification can express the Warren transformation using a single polymorphic dispatch function; there are static analyses that permit the runtime types to be omitted provided there are no function valued goal variables [7]. If there are function valued variables, some runtime type operations will need to remain, and it is not clear what level of static type checking can be guaranteed to the programmer; we are currently investigating this question. Our translation is presented as operating on an entire program at ....
Michael Hanus. Polymorphic higher-order programming in prolog. In Proc. 6th International Conference on Logic Programming, pages 382--397. MIT Press, June 1989.
....types on a single one. For instance, a constant with type (ff i) maps everything to a term of type i. However, it is not transparent since type variable ff appears in the argument type, but not in the result type. This violates safety conditions that allow to prove a semantic soundness theorem [7, 8, 10]. Second, generic polymorphism does not fit well with meta programming because a polymorphic object structure is degraded to a monomorphic type if no care is taken. Moreover, generic polymorphism and the head condition are not compatible with several useful program transformations. We will present ....
....conditions that make static typing possible. So, some dynamic typing is required, and our proposal gives a logical status to it. The emphasis of this work is different than previous works on higher order typing for logic programming [20, 4, 5] or polymorphic typing of higher order logic program [8]. The first type of work insists more on the ability to reason in a full higher order typed logic than we do. On the opposite, we are more concerned with the practical software engineering consequences of a type system. The second kind of work leaves open the question of the head condition, and ....
M. Hanus. Polymorphic higher-order programming in Prolog. In G. Levi and M. Martelli, editors, 6th Int. Conf. Logic Programming, pages 382--397, MIT Press, 1989.
....a static type checker checks that the declarations are respected. Dietrich and Hagl [12] propose a polymorphic type system for Prolog based on the system of Mycroft and O Keefe. They extend that system to deal with subtypes, when information about the possible dataflow in a clause is available. In [14] Hanus shows that polymorphic types allows the application of higher order programming techniques in Prolog, following a declarative approach in which the programmer has to declare all types of functions and predicates he wants to use in the program. 8.2 Type Inference Based on Success Types ....
M. Hanus. Polymorphic higher order programming in Prolog. In Proceedings of the Sixth International Conference and Symposium on Logic Programming, Cambridge, pages 382-- 397, MIT Press, 1989.
....in a language that is in reality typed and this turns out to be a useful feature in the process of program development. While types are useful only in determining program correctness in other lan 2 There have also been other exemplars of this approach see, for instance, 18] and [5]. guages, they also have a role to play in computation within Prolog. This role is twofold. First, they are useful in disambiguating overloaded operations. The mixing of polymorphism with the style of presentation of programs in Prolog in fact makes possible a form of overloading that can only ....
....process may erroneously be solved by the first clause if the type constraints on L1, L2 and L3 are not present at run time. The question naturally arises as to whether there are situations when the need for such information can be eliminated. The notion of type generality that is discussed in [5] for the case of first order programs effectively amounts to excluding ad hoc polymorphism to achieve this end. 3.4 Types and Unification The informal description of computation in the previous section alluded to differences between the operations of unification needed in Prolog and Prolog. One ....
[Article contains additional citation context not shown here]
Hanus, M. Polymorphic higher-order programming in Prolog. Proceedings of the Sixth International Logic Programming Conference, Lisbon, June 1989, MIT Press, 382 -- 398.
....situations in which success or failure in typed unification is not dependent on type annotations. One such situation, first presented in [15] and labeled in [8] as type generality, effectively amounts to banishing ad hoc polymorphism. 1 A generalization of this criterion is also described in [9]. While identifying such criteria is useful, this does not provide a scheme for dealing with situations in which the criteria described are not met. Further, the usual criteria presented for eliding types at run time depend on a crucial property of a first order language: types play a role in ....
....of clauses. In the first order context, types influence only the existence of unifiers and not their structure. It has therefore been suggested that analysis of types during execution may be eliminated in situations where the question of unifiability is itself independent of type information [9]. While this is of interest as an optimization technique, this is certainly not comprehensive enough to be an implementation strategy even for the first order case. Moreover, the underlying assumption does not generalize to other contexts of interest, such as that of a higher order language. In ....
Michael Hanus. Polymorphic higher-order programming in Prolog. In Giorgio Levi and Maurizio Martelli, editors, Proceedings of the Sixth International Logic Programming Conference, pages 382--398. MIT Press, 1989.
....For example, an individual term in predicate calculus may not appear as an atomic formula or be applied to other terms. The work on type systems for logic programs follows two main approaches. One adopts the thesis that the semantics of typed logic programs should be based upon a typed logic [13, 15, 21, 22, 28]. Most of the proposals are designed mainly for predicate calculus like languages and cannot accommodate the flexible syntax of HiLog. The other approach is meta theoretic in the sense that types are essentially constraints over type free logic programs [20, 33, 17, 16] A logic program may have a ....
M. Hanus. Polymorphic higher-order programming in prolog. In Intl. Conference on Logic Programming (ICLP), pages 382--397, Lisboa, Portugal, 1989. MIT Press.
.... Typing for terms and clauses is defined by typing rules, which are commonly used for typed calculus ( DM82, Bar92, Mit91] V T t : is true if and only if it is derivable using the rules (Var) Func) Subtype) 1 This condition is called transparency in [HT92] and type preserving in [Han89]. It is also part of the minimality condition in [Smo88] Var) V T [ fv : g v : T (Func) V T t 1 : Theta( 1 ) Delta Delta Delta V T t k : Theta( k ) V T f(t 1 ; Delta Delta Delta ; t k ) Theta( T if f : 1 Theta : Theta k is a declaration variant, ....
Michael Hanus. Polymorphic higher-order programming in Prolog. In G. Levi and M. Martelli, editors, Proc. 6th Int. Conf. on Logic Programming, pages 382--397, Lisbon, Portugal, 1989. The MIT Press.
....of Bruynooghe [3] Mycroft and O Keefe [23] and Mishra [21] a number of researchers extended these approaches to handle more general classes of logic programs and type systems. These works generally fall into two categories: those extending the prescriptive theory of Mycroft and O Keefe (e.g. [7, 17, 31, 12, 16, 10, 27, 13]) and those inspired by the descriptive type inference system of Mishra [22, 18, 39, 1, 9, 26, 36, 37, 15, 11] In the prescriptive approach, Mycroft and O Keefe [23] adopted Milner s slogan that welltyped programs do not go wrong , meaning that if a logic program and a query is well typed, then ....
....in the past to specify types [10, 38] However, a different type system was used, one that does not satisfy many of the requirements above (notably, robustness of polymorphism) and typing was specified only for Prolog programs a first order subset of HiLog. As far as we know, Prolog [24] and [12] are the only other works that describe a polymorphic type system for higher order logic programs. However, Prolog [24] does not incorporate inclusion polymorphism. The language in [12] is essentially the second order predicate calculus with nonstandard semantics described in [8, Section 4.4] The ....
[Article contains additional citation context not shown here]
M. Hanus. Polymorphic higher-order programming in prolog. In Intl. Conference on Logic Programming (ICLP), pages 382--397, Lisboa, Portugal, 1989. MIT Press.
No context found.
M. Hanus, Polymorphic higher-order programming in Prolog., Proc. 6th International Conference on Logic Programming, Lisbon, 1989, pp. 382--397.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC