Re: comparing two programs? (J P Bennett)
Fri, 29 Apr 1994 13:42:21 GMT

          From comp.compilers

Related articles
comparing two programs? (1994-04-18)
Re: comparing two programs? (Bryan O'Sullivan) (1994-04-19)
Re: comparing two programs? (1994-04-20)
Re: comparing two programs? (1994-04-20)
Re: comparing two programs? (1994-04-26)
Re: comparing two programs? (1994-04-29)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (J P Bennett)
Keywords: tools
Organization: School of Mathematical Sciences, University of Bath, UK
References: 94-04-124 94-04-165
Date: Fri, 29 Apr 1994 13:42:21 GMT

There was an article on this problem in one of the mainstream computer
journals a year or two ago. I think is was CACM, but I can't track it down
at the moment.

You certainly don't want to do pairwise comparisons. Far better to choose
an indicator (number of basic blocks for example), sort on this (n log n)
and compare programs close together in the sorted list. Ultimately you're
going to have to check by hand to decide, we only want to speed your
search up.

Shared code, doesn't always mean plagiarism. Part of computer education is
learning from your peers, and a fallacy can be easily propagated. As an
example I set students a problem this year, to add an exponentiation
operator, ^, to a compiler (written in C) for a simple language.

Most of them got the correct idea, and realised you should do constant
folding for the new operator. All but two used ^ to evaluate the constant
expression, forgetting that in C this is the exclusive-OR operator, not
exponentiation. Looking at the code showed that this was where someone
had suggested doing constant folding using ^ and others while implementing
it had not realised the error.

Good luck with your grading!

Jeremy Bennett Tel: +44 (225) 826891
School of Mathematical Sciences Telex: 449097 UOBATH G
University of Bath Fax: +44 (225) 826492 (Group 3)
Bath, BA2 7AY, England Email:

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.