Code Comments
Programming Forum and web based access to our favorite programming groups.im a beginner in PROLOG.i need urgent help with a simple prolog code.i need to write a predicate parse/2 that would check the validity of an input string against the given grammar.for eg. ?- parse(s, [a, b]). Yes should be the output.could any one let me know how to write the predicate for this. Thanks.
Post Follow-up to this messageIn message < 09e77daf92c4fc32d1d852f4f31c72c1@localho st.talkaboutprogramming.com>, Pro_novice <cyb014@rediffmail.com> writes >im a beginner in PROLOG.i need urgent help with a simple prolog code.i need >to write a predicate parse/2 that would check the validity of an input >string against the given grammar.for eg. > >?- parse(s, [a, b]). >Yes > >should be the output.could any one let me know how to write the predicate >for this. I don't understand this. For one thing, it sounds far too hard for a beginner. For another, you refer to "an input string" and "the given grammar". But in your sample call parse(s, [a, b]), there is no string. And is [a, b] in some way a grammar? Nick -- Nick Wedd nick@maproom.co.uk
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.