Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!nbires!hao!noao!arizona!debray From: debray@arizona.UUCP Newsgroups: comp.lang.prolog Subject: Re: Prolog control structures Message-ID: <1609@megaron.arizona.edu> Date: Wed, 1-Apr-87 23:56:30 EST Article-I.D.: megaron.1609 Posted: Wed Apr 1 23:56:30 1987 Date-Received: Sat, 4-Apr-87 19:48:18 EST References: <10588@topaz.RUTGERS.EDU> <1608@megaron.arizona.edu> Organization: U of Arizona CS Dept, Tucson Lines: 19 Summary: even simpler solutions I'd proposed the following solutions to Chomicki's problems: > Assuming no side effects, the following works on most Prologs: > > (1) xor(G1,G2) :- not(not(call(G1))) -> call(G1) ; call(G2). > > (2) P :- ( not(not( (A,B) )) -> (A -> B) ; (A, B) ), C, D. > The following simplifications should now be obvious: (1) xor(X,Y) :- not(call(X)) -> call(Y) ; call(X). (2) P :- ( not( (A -> B) ) -> (A, B) ; (A -> B) ), C, D. -- Saumya Debray CS Department, University of Arizona, Tucson internet: debray@arizona.edu uucp: {allegra, cmcl2, ihnp4} !arizona!debray