Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!news.mathworks.com!uunet!sunsite.dcc.uchile.cl!dcc.uchile.cl!cc41a
From: cc41a@dcc.uchile.cl (Lenguajes de Programacion)
Subject: Re: speed of prolog
Message-ID: <D9rCu0.Ips@dcc.uchile.cl>
Sender: usenet@dcc.uchile.cl (News)
Organization: The Firm, Big Division
References: <3pam2e$9jh@chuangtsu.acns.carleton.edu> <3pptgj$6do@percy.cs.bham.ac.uk> <D90wt4.32n@cee.hw.ac.uk> <9514714.11493@mulga.cs.mu.OZ.AU>
Date: Tue, 6 Jun 1995 15:39:35 GMT
Lines: 23

In article <9514714.11493@mulga.cs.mu.OZ.AU>, fjh@munta.cs.mu.OZ.AU (Fergus Henderson) writes:
|> andrew@cee.hw.ac.uk (Andrew Dinn) writes:
|>
|> If there are any tasks where Prolog can out-perform C or C++,
|> they are *very* few and far between.  I challenge anyone to
|> produce such a Prolog program.  I am very confident that I
|> could write a C/C++ program with equal or better performance.
|>

  Ok, Fergus, Let us say we will make a program, you in C++ and I in Prolog,
that puts 8 queens in a chess board in a way that no one threatens each other.
  As you could make a static choice (having an array with the solution and
displaying it), let us make a program that receives the number of queens (and
obviously the number of squares in the board would be n*n).
  Do you think you can post it tomorrow, so anyone can test it?
  We will time the program from the moment you enter the number until the moment
it displays a solution to the problem.
  If you want, we can display the answer in the same way. I'm going to display
in which row will be the queen at row i.
  For example, for a board of 4*4 => 4 queens:
  Solution:  [3,1,4,2]

  I hope you accept the deal.
