LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-15-2012, 11:01 AM   #1
famsinyi
LQ Newbie
 
Registered: Nov 2007
Posts: 25

Rep: Reputation: 0
reverse c++ processing


Hi,

I'm developing a tool that work as "reverse c++ processing", this tool parse the source code and find out all the argument and input that needed by a program to reach certain line in source code. The detail is in http://www.revexecute.com. Please give comment. I'm actually looking for partner for the development as well.

Thanks
 
Old 08-17-2012, 06:35 AM   #2
gzunk
Member
 
Registered: Sep 2006
Posts: 89

Rep: Reputation: 20
Sorry, but I don't think what you're attempting is feasible. Static lexical analysis of a program isn't enough to determine which code path gets executed, you would have to also take into account the dynamic execution environment. This is especially true of a multi-threaded / event driven program.

In effect what you're trying to do is solve the Halting Problem, which has been proved by Alan Turing to be unsolvable for Turing Machines (all current computers). The Halting Problem is that given a description of an arbitrary computer program (your source) decide whether the program finishes running or not (reaches a particular point of code).

I'd be happy to be proved wrong though!
 
Old 08-18-2012, 12:11 AM   #3
famsinyi
LQ Newbie
 
Registered: Nov 2007
Posts: 25

Original Poster
Rep: Reputation: 0
Thanks a lot

I'll look into your comment seriously. It really make sense if someone had concluded that 'Halting problem' is not solvable.

Thanks
 
Old 08-18-2012, 06:32 AM   #4
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
If I get it right, the Halting Problem says that there is no universal program which can decide this for all algorithms. Nevertheless someone could write a program which could output “yes”, “no” or “don’t know” for a given algorithm.
 
Old 08-19-2012, 05:19 AM   #5
gzunk
Member
 
Registered: Sep 2006
Posts: 89

Rep: Reputation: 20
Quote:
Originally Posted by Reuti View Post
If I get it right, the Halting Problem says that there is no universal program which can decide this for all algorithms. Nevertheless someone could write a program which could output “yes”, “no” or “don’t know” for a given algorithm.
Yes, you're right. For some programs it's trivial - a singe line Hello World program would be an example where you could decide, however the OP was planning on writing a piece of software that did it for all programs, which is a different matter altogether. Additionally, it's not easy to write a program to determine which category a given program would fall into.

It's possible to look at a simple program yourself and decide if it finishes or not, but that's because you're using a highly parallel pattern recognition engine with heuristics built up through experience, i.e. your brain, but writing a piece of software that does the same thing is significantly more challenging.

Quote:
Originally Posted by famsinyi View Post
It really make sense if someone had concluded that 'Halting problem' is not solvable.
Not just "somebody", but Alan Turing, one of the titans of computer science! To quote wikipedia: "Turing is widely considered to be the father of computer science and artificial intelligence."

Last edited by gzunk; 08-19-2012 at 05:47 AM.
 
Old 08-19-2012, 10:30 PM   #6
famsinyi
LQ Newbie
 
Registered: Nov 2007
Posts: 25

Original Poster
Rep: Reputation: 0
should look it from human perspective

Hi,

I remembered when I analysed while loop and recursive function for my tool, a purposely weirdly written loop or recursive function could easily defeats my algorithm. But such loop or function seems really weird until most programmers couldn't understand what it is trying to do, or there is no real world application would need such a function, loop (If you guys need an example, I could prepare). If the tool is targeted for applications that human could understand, I believe it is feasible.

A study called 'dynamic program slicing' has the same objective with what I'm trying to do. May I know anyone of you feel this kind of tool useful? Or it is just a kind of 'advance' debugging tool that will not be widely used?

Thanks
 
  


Reply

Tags
c++, debugging, processing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse Tunneling / Reverse port forwarding in SSH dynamics Linux - Networking 5 02-07-2017 07:19 AM
[SOLVED] data processing mailbox-1691 Linux - Software 6 04-22-2011 11:45 AM
[SOLVED] bind reverse zone; no name with reverse lookup deadeyes Linux - Server 3 10-12-2009 09:54 AM
PDF processing elfoozo Linux - Desktop 1 02-03-2007 10:51 PM
dual processing jonfa Linux - General 3 06-01-2001 08:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration