Discussions related to Visual Prolog
User avatar
Gukalov
VIP Member
Posts: 64
Joined: 5 Oct 2011 15:16

Flow Pattern in domains

Unread post by Gukalov »

Code: Select all

domains     pd1 = (unsigned) -> unsigned nondeterm (i).     pd2 = (unsigned) -> unsigned nondeterm (o).     pd3 = (unsigned) -> unsigned nondeterm (i) (o).     pd4 = (unsigned) -> unsigned nondeterm anyflow.
pd3:
e150 Syntax error
pd4:
e243 Illegal flow pattern 'anyflow'

I have some old VIP version. Does it work today!?
User avatar
Thomas Linder Puls
VIP Member
Posts: 1418
Joined: 28 Feb 2000 0:01

Re: Flow Pattern in domains

Unread post by Thomas Linder Puls »

No, anyflow cannot be used on a predicate domain, only on a local predicate declaration. And the general suggestion is not to use it at all it is only present to support ancient code.
Regards Thomas Linder Puls
PDC
User avatar
Gukalov
VIP Member
Posts: 64
Joined: 5 Oct 2011 15:16

Re: Flow Pattern in domains

Unread post by Gukalov »

Actually, I don't try to use "ancient magic" anyflow.
I try to declare predicate domain with two flow patterns.

Code: Select all

domains     pd1 = (unsigned, unsigned, unsigned) nondeterm (i, o, o).              % o'k     pd2 = (unsigned, unsigned, unsigned) nondeterm (o, i, o).              % o'k     pd2 = (unsigned, unsigned, unsigned) nondeterm (i, o, o) (o, i, o).    % error
The result is:
e150 Syntax error main.pro
What a pity...
User avatar
Thomas Linder Puls
VIP Member
Posts: 1418
Joined: 28 Feb 2000 0:01

Re: Flow Pattern in domains

Unread post by Thomas Linder Puls »

Yes, but one predicate cannot have two flows; when you provide two flows to a predicate declaration you effectively declare two predicates.

Code: Select all

predicates     p : (integer) (i) (o).
is the same as:

Code: Select all

predicates     p : (integer) (i).     p : (integer) (o).
Regards Thomas Linder Puls
PDC
Post Reply