Computer Science Canada Method of decision

 Author: Manqueba [ 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; }

 Author: Insectoid [ 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?

 Author: Manqueba [ 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.

 Author: Insectoid [ 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.

 Author: Manqueba [ 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.

 Author: Insectoid [ 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.

 Author: Manqueba [ 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.

 Author: Insectoid [ 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.

 Author: Manqueba [ 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.

 Author: Insectoid [ 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.

 Author: Manqueba [ Sat May 27, 2017 9:32 am ] Post subject: Re: Method of decision Thanks for the answer!

 :