🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2672

A meta puzzle

#2672
From: Arun Lakhotia
Date: Sat, 09 May 1987 07:49
71 lines
2393 bytes
While the subject of meta-interpreters is still on, let me give
an interesting coffee time puzzle. 

  solve(true,true).
  solve((GoalA,GoalB),(GoalC,GoalD)):-
      solve(GoalA,GoalC),
      solve(GoalB,GoalD).
  solve(GoalA,GoalB) :-
      sys(GoalA),
      sys(GoalB),
      call(GoalA),
      call(GoalB).
  solve(HeadA,HeadB) :-
      clause(HeadA,BodyA),
      clause(HeadB,BodyB),
      solve(BodyA,BodyB).


Q? For what class of programs would solve(GoalA,GoalB)
   be equivalent to solve(GoalA), solve(GoalB).

Q? If solve(GoalA,GoalB) is true then can one make any comment about
   the relation between the proof-tree, search tree for the two goals.
   with (or without :-)) respect to solve(GoalA) and solve(GoalB).

Q? Can any comment be made about the relation between the clauses that
   are used for asserting GoalA and GoalB for solve(GoalA,GoalB) to be
   true. 

   where solve(Goal) is as follows.

solve(true).
solve((GoalA,GoalB)) :-
     solve(GoalA),
     solve(GoalB).
solve(Goal) :-
     sys(Goal),
     call(Goal).
solve(Head) :-
     clause(Head,Body),
     solve(Body).


BACKGROUND

For people who may be interested in the source of this program. 
The program is the result of composition of  meta-interpreters. 

I took the clause

    solve(GoalA,GoalB) :- solve(GoalA), solve(GoalB).

and applied some simple fold/unfold transformation on it, with a
strategy to unfold the same clause for both the goals simultaneously.
With a little more story i got the program solve(GoalA,GoalB).

The complete semantics of the program is still a puzzle to me.

One statement that i could make is 

   solve(GoalA,GoalB) implies (solve(GoalA), solve(GoalB))

=
   Have Fun

Arun Lakhotia

UUCP  : ..!cbatt!cwruecmp!arun
Csnet : arun@case
Arpanet: arun%case@csnet-relay
Technical Details
Message-ID: <2098@cwruecmp.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!clyde!cbatt!cwruecmp!arun

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!clyde!cbatt!cwruecmp!arun
From: arun@cwruecmp.UUCP (Arun Lakhotia)
Newsgroups: comp.lang.prolog
Subject: A meta puzzle
Message-ID: <2098@cwruecmp.UUCP>
Date: Sat, 9-May-87 03:49:49 EDT
Article-I.D.: cwruecmp.2098
Posted: Sat May  9 03:49:49 1987
Date-Received: Sun, 10-May-87 08:45:54 EDT
Reply-To: arun@cwruecmp.UUCP (Arun Lakhotia)
Distribution: world
Organization: CWRU Dept. of Computer Engineering, Cleveland, Ohio
Lines: 71