Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: XBASIC to Perl translator: semantical equity

by gjb (Vicar)
on Apr 16, 2004 at 11:54 UTC ( #345731=note: print w/ replies, xml ) Need Help??


in reply to XBASIC to Perl translator: semantical equity

To answer your questions in order:

  1. In general, there's no formal way to prove that two programs do the same thing, and that has been proven. The next best thing is to device as many test cases as feasible and cross your fingers.
  2. If it doesn't exist, it is not a trivial exercise since you have to write a parser for XBasic and add semantic actions to generate equivalent Perl code from the parse tree. It can be done though.
It's too long ago I looked at BASIC to answer your third question.

Hope this helps, -gjb-


Comment on Re: XBASIC to Perl translator: semantical equity
Re: Re: XBASIC to Perl translator: semantical equity
by abell (Chaplain) on Apr 17, 2004 at 08:45 UTC
    In general, there's no formal way to prove that two programs do the same thing

    That is true, but in this particular case the OP would be generating the code himself and would not just be given two programs and asked if they are equivalent. Thus, he could just prove that he is converting all simple instructions properly, that the execution model is the same (eg. instructions are processed sequentially except in conditionals and loops and those are processed in equivalent ways) and the equivalence of the programs would follow.

    The next best thing is to device as many test cases as feasible

    This is a commendable suggestion at any rate.



    The stupider the astronaut, the easier it is to win the trip to Vega - A. Tucket

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://345731]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2014-10-02 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (43 votes), past polls