Discussions related to Visual Prolog
huynguyen
Posts: 2
Joined: 22 Sep 2017 6:41

compiler error code c603

Unread post by huynguyen »

Dear Thomas Linder Puls,
Thanks a lot for your advice.
I have another problem with this code:
It stick on compiler error c603:
The flow pattern 'Flow' does not exist for 'Member'

I try to repair but cannot. I want to download and study your online example but they was programmed using older version (v7.2 or 7.3)

Is there any tutorial for VS Prolog 7.5?

please help!
Nguyen Van Huy
Director
iDataBox J.S.C
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt »

The compiler is telling you that there is a mismatch between the flow pattern (o,i,i,i) you defined for the normal/4 predicate and what it infers that the code you have written is trying to do -- (i,i,i,i).

Code: Select all

 
Hint: You can improve readability of your code if you restructure some of the predicates to better imply your intent. Also, using meaningful variable names make your program logic easier for you to understand instead of using X, XXX and YY.


For example, restructure normal/3 to be a deterministic predicate that will succeed or fail, rather than return a value.

Code: Select all

class predicates     isNormal : ( integer , integer UpperLimit, integer LowerLimit ) determ. clauses     isNormal( Y , UpperLimit,LowerLimit ):-         Y < UpperLimit,         Y > LowerLimit, !.     isNormal( _,_,_) = false.
Or if you need to use true or false elsewhere, do something like this:

Code: Select all

class predicates     isNormal : ( integer , integer UpperLimit, integer LowerLimit ) -> boolean determ. clauses     isNormal( Y , UpperLimit,LowerLimit ) = true :-         Y < UpperLimit,         Y > LowerLimit, !.     isNormal( _,_,_) = false.
huynguyen
Posts: 2
Joined: 22 Sep 2017 6:41

compile error code c603

Unread post by huynguyen »

Dear Harrison Pratt,
Thanks you very much.
I'd started with prolog in ten years ago. From 2007, I'd not used it till now.
I just start again in a week but there's not enough document to understand Prolog clearly.

Can you give me some document like teach myself VS Prolog? Or give me some useful books name.

Thank you again
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt »

A good place to start is here: http://wiki.visual-prolog.com/index.php ... log_Part_1

Then go here: http://wiki.visual-prolog.com/index.php ... ual_Prolog

Tutorials are here: http://wiki.visual-prolog.com/index.php ... :Tutorials

Don't forget that you can download the current version free or Commercial Edition here: http://www.visual-prolog.com/vip/download/default.htm

The free Personal Edition should have all you need to get yourself restated with Visual Prolog.
Post Reply