Discussions related to Visual Prolog
Paul Cerkez
VIP Member
Posts: 106
Joined: 6 Mar 2000 0:01

Help! trying to figure out what I am doing wrong

Unread post by Paul Cerkez »

I have a simple program that I believe I have solved all the syntax issue except one.

I searched the Help[ and this board for error c504

As near as I can tell, I have it correct but the complier keeps throwing the c504.

error c504 : The expression has type '() -> ::string procedure', which is incompatible with the type '::string'

Code: Select all

% The declaration:   class predicates     patient : (string).  % I even made this nondeterm and I still get the C504 message.   clauses     patient(S) :-         patresponses(S),         stdio::write("you are repeating yourself."),         stdio::nl,         stdio::write(": "),         S2 = stdio::readLine,         patient(S2).     patient(S) :-         assert(patresponses(S)),         assert(temp(S)).
I am stumped, I know I am missing something simple.

Thanks,
P.
AI Rules!
P.
Paul Cerkez
VIP Member
Posts: 106
Joined: 6 Mar 2000 0:01

Re: Help! trying to figure out what I am doing wrong

Unread post by Paul Cerkez »

I know I am missing something simple but I can't figure it out.

Could someone look this project over and tell me where I am AFU. (that c504 for one is kicking my butt, and when I do get past it, the application runs non-stop and allows no interaction.)

I know I am doing something wrong but I can't see what it is.

Right now I can't see the forest for the trees. :-(

Thanks
P.
Attachments
the Doctor.zip
(4.97 KiB) Downloaded 369 times
AI Rules!
P.
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: Help! trying to figure out what I am doing wrong

Unread post by Harrison Pratt »

Try this instead:

Code: Select all

        S2 = stdio::readLine()  % <== missing parentheses,
Easy mistake to make ... I've done it hundreds of times with my tired old eyes.
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: Help! trying to figure out what I am doing wrong

Unread post by Harrison Pratt »

Paul, is it your intent to recreate "The Shrink" in old style prolog syntax or migrate it to VIP 9x syntax?
Paul Cerkez
VIP Member
Posts: 106
Joined: 6 Mar 2000 0:01

Re: Help! trying to figure out what I am doing wrong

Unread post by Paul Cerkez »

Harrison,
Right now I just want to get it working. :-)

That said, I do want it working as a Console app. New way or old is irrelevant to me right now. Eventually, I will go to the new syntax.

I am also looking at a PIE exercise for the students so I don't want to introduce too much at one time as this is an "intro to AI" class. :-)

They have already completed a CLIPS exercise that I am grading now (they had to extend the CLIPS fact/rule base). Looks like some did a good job. CLIPS is Forward Chaining. I want them to do a Backward Chaining (Prolog) problem (extend the fact/rule base) so they can learn the difference in the way the two tools solve problems.
AI Rules!
P.
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: Help! trying to figure out what I am doing wrong

Unread post by Harrison Pratt »

I'll take a look at it tomorrow.
Paul Cerkez
VIP Member
Posts: 106
Joined: 6 Mar 2000 0:01

Re: Help! trying to figure out what I am doing wrong

Unread post by Paul Cerkez »

thanks.
AI Rules!
P.
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: Help! trying to figure out what I am doing wrong

Unread post by Harrison Pratt »

Paul, take a look at my notes on the zipped main.pro file. I see you don't have everything fleshed out yet -- I understand why. This is not a complete solution, but it will get you started. I tried to keep old Turbo Prolog syntax. VIP 9x code style would be much cleaner looking.
Attachments
main.zip
Tweaked and zipped main.pro
(1.7 KiB) Downloaded 389 times
Post Reply