Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Method of decision
Author Message
Manqueba

Posted: Tue May 16, 2017 3:44 pm   Post subject: Method of decision

Good night, Can someone give me a hand?
I need to turn this recognition method into an equivalent decision method.

boolean r1(String p){

while(true){}
return true;

}
Sponsor
Sponsor

Insectoid

Posted: Tue May 16, 2017 6:17 pm   Post subject: RE:Method of decision

Can you explain in more detail what you're trying to do, and what problem you are having?
Manqueba

Posted: Tue May 16, 2017 6:52 pm   Post subject: Re: Method of decision

This is a method of recognition, which when entering the loop does not stop. I want to understand how to turn it into a method of decision and what Boolean return should be given. The new method has to accept the same language as the old.
Insectoid

Posted: Wed May 17, 2017 6:37 pm   Post subject: RE:Method of decision

I'm still not sure what you're asking. 'method of recognition/decision' is not standard terminology. I don't know what that phrase means and your description isn't clear enough to help.
Manqueba

Posted: Thu May 18, 2017 9:58 am   Post subject: Re: Method of decision

Okay ... a recognition method parses an entry, and checks to see if it belongs to a particular language, and can return a Boolean value or enter an infinite loop. A decision method parses an entry, checks whether or not this entry belongs to the language and returns only false or true and never goes into infinite loop.
Insectoid

Posted: Sun May 21, 2017 1:29 pm   Post subject: RE:Method of decision

Well, in that case, just get rid of the loop entirely, and if true, return true, otherwise return false.

I don't know what you're checking or what you're trying to accomplish here. None of your descriptions make sense or have any sensical application. There is never any practical reason to enter an infinite loop, and therefore no practical use for a 'recognition method', ever. That is simply not a thing that exists in the real world.
Manqueba

Posted: Sun May 21, 2017 5:25 pm   Post subject: Re: Method of decision

This problem is a theoretical issue.
Its functionality in practical life is despised, however it is a possibility.
I could leave this loop with a stop command, but I would like to know what the Boolean return should be, so that the new method is equivalent to the old one.
Insectoid

Posted: Sun May 21, 2017 5:48 pm   Post subject: RE:Method of decision

They will never be equivalent if one enters an infinite loop and the other does not. Your recognition method either returns true, or doesn't return anything. If you use stop to exit the loop, you still need to know *when* to stop, and then you need to return something but you can't.

Your decision method either returns true or false. It always returns something, by your definition. These functions cannot possibly be equivalent. It's Impossible to do without redefining it.
Sponsor
Sponsor

Manqueba

Posted: Fri May 26, 2017 10:02 am   Post subject: Re: Method of decision

"Your decision method either returns true or false. It always returns something, by your definition. These functions cannot possibly be equivalent. It's Impossible to do without redefining it."

This passage is very enlightening. Analyzing this method, since it will never return true, can I interpret that it could strip the loop, and just return false ??
Recalling that this method is only a theoretical exercise.
Insectoid

Posted: Fri May 26, 2017 4:13 pm   Post subject: RE:Method of decision

What are you theorizing? This seems like a pointless exercise in useless nomenclature, purely for the sake of it. You're asking how to turn function a into function b, but the answer is to literally just throw away function a and replace it with b. You might as well ask how to turn Pacman into Call of Duty. I don't understand why you are bothering with this at all.
Manqueba

Posted: Sat May 27, 2017 9:32 am   Post subject: Re: Method of decision

Thanks for the answer!
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 11 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: