Discussions related to Visual Prolog
Gukalov
VIP Member
Posts: 68 Joined: 5 Oct 2011 15:16
Post
by Gukalov » 20 May 2024 12:21
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!?
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 21 May 2024 8:01
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
Gukalov
VIP Member
Posts: 68 Joined: 5 Oct 2011 15:16
Post
by Gukalov » 22 May 2024 10:47
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...
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 22 May 2024 13:10
Yes, but one predicate cannot have two flows; when you provide two flows to a predicate declaration you effectively declare two predicates.
is the same as:
Code: Select all
predicates
p : ( integer) ( i) .
p : ( integer) ( o) .
Regards Thomas Linder Puls
PDC