| OCR Text |
Show A goal of equalities is a conjunction of equalities, and is of the f orm ?- A0 = B0 , A1 = B1 , • •• , Am = Bm . , w here A. and B. are terms. There is a distinguished goal, called the I I empty goal. 0 Two of the commonly used conditional functio ns can be defined as: if_then_else(true, X, Y) = X if_t hen_else(false, X, Y) = Y if_t hen (true, X) = X where true and false are two consta nt f unction symbols. 82 It should be mentio ned that canonical term rewriting systems do not usually make use of conditiona l fu nct ions, for the reason that conditional f unc-tions often introduce nont ermi nating reduction sequences. Consider, for ex-ample, the familiar def init ion for fact orial factorial(N) = if N = 0 then else N *factorial (N-1). In almost all the existing f unctional programming languages, the conditional equations if_ then_ else is treated as being nonstrict, hence ensuring termination for appropriate computations. Viewed as a term rewriting system, however, the termination property is lost; for example, the invocation of factorial ( -4) will result in an infinite reduction sequence. This appears to be a major dif-ficulty for formalizing an equality-based computational model for canonical t erm rewriting systems. 5.2.2 Operational Semantics The operational semantics of equational logic programs defined here con-sists of two inference rules: narrowing and deletion upon unification. Definition 5-2: Let G be a goal of equalities ?- A0 = 80, A1 = 8 1, ... , Am = Bm. |