Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume you have a source program P. It is possible to transform P into an equiva

ID: 3600864 • Letter: A

Question

Assume you have a source program P. It is possible to transform P into an equivalent program P by reformatting P (by adding or deleting spaces, tabs, and line breaks), systematically renaming its variables (for example, changing all occurrences of sum to total), and reordering the definition of variables and subroutines. Although P and P are equivalent, they may well look very different. How could a compiler be modified to compare two programs and de- termine if they are equivalent (or very similar)? In what circumstances would such a tool be useful?

Explanation / Answer

Please see the below answer.

Answer:

Mainly by calculating running time of each programs like P and P’ compiler could be modified to compare two programs and determine P and P’ are equivalent or not.

Though Translation validation is required to ensure that the compiler does not change its semantics of the source program P here on interpersonal loop optimization of the problems where as regression verification for inter procedural refactoring.

There are two methods to for comparing two programs doing same operation by changing the variables names and all by compiler.

There are two methods to for comparing two programs doing same operation on modularity by compiler .

For checking the modularity and scalability this tools are useful to handle this circumstances.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote