C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Equivalence Checing Tool for C/C++

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
rramanujam@gmail.com
Guest





PostPosted: Thu Nov 24, 2005 5:14 pm    Post subject: Equivalence Checing Tool for C/C++ Reply with quote




Is anybody aware of a tool that can check whether 2 C/C++ codes are
equivalent by doing static checks


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Ira Baxter
Guest





PostPosted: Sun Nov 27, 2005 5:50 pm    Post subject: Re: Equivalence Checing Tool for C/C++ Reply with quote



<rramanujam (AT) gmail (DOT) com> wrote

Quote:

Is anybody aware of a tool that can check whether 2 C/C++ codes are
equivalent by doing static checks

There's a theorem that says you can't do this in general.
I suspect it is pretty hard in practice, and you'd need
one hell of a theorem prover.

What you can do is to verify that one code is probably
a cut-n-paste copy of another, by matching program
parses of program source codes.

See http://www.semdesigns.com/Products/Clone/index.html


--
Ira D. Baxter, Ph.D., CTO 512-250-1018
Semantic Designs, Inc. www.semdesigns.com



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


Back to top
Gene Bushuyev
Guest





PostPosted: Sun Nov 27, 2005 9:53 pm    Post subject: Re: Equivalence Checing Tool for C/C++ Reply with quote



<rramanujam (AT) gmail (DOT) com> wrote

Quote:

Is anybody aware of a tool that can check whether 2 C/C++ codes are
equivalent by doing static checks

There is no such tool. Though theoretically it's possible to check equivalence
of any two FSMs, in practice it only works when the number of collapsed states
(e.g. BDD nodes) is relatively small. Look for the papers on reachability
analysis for explanation of the theory.
Relatively simple FSMs, like event-driven transaction models can be verified.
It's an interesting exercise to write an equivalence checker for two parser
implementations. But general software applications have too many states for any
general purpose tool to be viable.

-- Gene Bushuyev
----------------------------------------------------------------
There is no greatness where there is no simplicity, goodness and truth. ~ Leo
Tolstoy


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


Back to top
ben
Guest





PostPosted: Mon Nov 28, 2005 4:28 pm    Post subject: Re: Equivalence Checing Tool for C/C++ Reply with quote

[email]rramanujam (AT) gmail (DOT) com[/email] wrote:
Quote:
Is anybody aware of a tool that can check whether 2 C/C++ codes are
equivalent by doing static checks


No general tool I know of can perform this equivalence check.

In order to prove that two pieces of code are equivalent you need to
feed them with all possible inputs and compare their outputs. This, of
course, is specific to the code itself. Given the complexity of today's
commercial software, it is nearly impossible to do that because there
are simply too many combinations of inputs.

Ben

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


Back to top
Jeffrey Schwab
Guest





PostPosted: Mon Nov 28, 2005 9:07 pm    Post subject: Re: Equivalence Checing Tool for C/C++ Reply with quote

ben wrote:
Quote:
rramanujam (AT) gmail (DOT) com wrote:

Is anybody aware of a tool that can check whether 2 C/C++ codes are
equivalent by doing static checks



No general tool I know of can perform this equivalence check.

In order to prove that two pieces of code are equivalent you need to
feed them with all possible inputs and compare their outputs.

Not quite true. What you have described would not, by definition, be a
"static check." In the processor design industry, it is common to use
symbolic logic to establish the formal equivalency of different
"models." Synopsys is probably the most popular vendor of formal
equivalency tools:

http://synopsys.com/products/solutions/discovery/func_checking/func_checking.html

These techniques are all about mapping state points between different
models. Usually, the models are written in Verilog or VHDL, which are
very special-purpose languages. However, Mentor Graphics (who are
competitive with Synopsys) seem to be pushing the use of C++ as an
alternative to traditional hardware design languages, at least for
synthesis tools:

http://www.mentor.com/products/c-based_design/catapult_c_synthesis/index.cfm

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.