| OCR Text |
Show 118 ter 4, we obtain a system of Prolog with equality. It should be noted that, when the semantic unification algonthm is used, Funlog combines logic programming and "traditional" functional programmmg m that only ground terms are reduced and function reductions do not involve backtracking, and when the E-unification algorithm described in Chapter 4 is employed, Funlog combines logic programming and "extended" functional programming in that nonground terms are handled by narrowing. Backtracking, however, is needed in the extended functional programming, 6.2.3 Semantic Foundations A Funlog program generally consists of a set of equations and a set of Horn clauses. A Horn clause is of the form A : - B 1 , B2 , ••• , B n • , where a predicate Bi in the clause body can be of the form M =E N where M and N are terms. An equation A =E B in a goal will invoke E-unification (or semantic unification). A term can involve function symbols defined by some equations. The operational semantics for Funlog as a whole is the resolution procedure based on E-unification, or the semantic unification algorithm if its limitations on expressiveness are acceptable. (In the interpreter design described later, only the semantic unification algorithm is discussed.) Let P be a program and A' be a predicate. A' is provable in P iff there exists a clause A :- B1 , B2 , ••• , Bn. , and a substitution rr , such that rr(A') =E rr{A) and rr{B 1), rr(B 2), ... , and rr{Bn) are all provable. In the case that n = 0, A' is provable in P iff rr{A') =E rr(A). The actual proof is carried out by a resolution procedure based on complete E-unification algorithms. , The meaning of a Fun log program can be described as follows. The set of equations in EON defines the finest congruence relation =E over the Herbrand universe H. =E can be viewed as being obtained by using substitutions and by replacing equals by equals. Let P denote a Funlog program and A' a predicate. |