Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!ukc!eagle!icdoc!cdsm From: cdsm@doc.ic.ac.uk (Chris Moss) Newsgroups: comp.lang.prolog Subject: Operator Tests for Prolog Message-ID: <504@ivax.doc.ic.ac.uk> Date: Mon, 27-Jul-87 06:07:40 EDT Article-I.D.: ivax.504 Posted: Mon Jul 27 06:07:40 1987 Date-Received: Thu, 30-Jul-87 07:03:18 EDT Sender: cdsm@doc.ic.ac.uk Reply-To: cdsm@doc.ic.ac.uk (Chris Moss) Organization: Dept. of Computing, Imperial College, London, UK. Lines: 153 You may have noticed there are subtle differences between the way different Prolog handle operator definitions. The test file below is designed to explore some of these on the lines of some of my earlier tests. Post the results direct to me please and I'll post a summary to the net. /* Test of Prolog operator implementations Chris Moss. July 1987. cdsm@doc.ic.ac.uk (or cdsm@icdoc.uucp) Compile and execute the predicate optest, supplying full description of system used (with version) as the second parameter. If necessary delete any clauses which give syntax errors but do NOT change them in any way (spaces may be crucial). Skip any run-time errors. Send me the resultant file if it is NOT one of the following or the results are different. If you get a "parsed differently" message I'd welcome a modified test which illustrates it as well; also let me know if you've had to make any changes. You may change the operator declarations if your system has different conventions. e.g. If your operator precedence is in the opposite direction then you may add some suitable constant to ALL the operator priorities. Thanks to Hamish Taylor for some of these tests. Note that some of the answers are definitely WRONG. I leave you to decide which! These are the results I already have (first letter of each message): Version \ Test 1 2 3 4 5 6 7 8 91011121314151617181920 CProlog 1.5 M P - S - M S P A A A - N N P R D L N Quintus 2.0 M P - S C M S P A A A - N N P N D L N MACProlog 2.0 M P - S L L - P A A A - N N P R D L S Poplog 9.3 D S P P R R S S P S P P N P - R - - - MuProlog 3.1db M P P P R R P P P P P P P P P R - - - */ optest(File,Version) :- tell(File), write(['Operator test version 2 using',Version]), nl, nl, ptest(Summary), write(Version), write(' '), summary(Summary), told. ptest(Summary) :- ptest(1,19,Summary), nl. ptest(I,N,[]) :- I>N, !. ptest(I,N,[S|Rest]) :- I=