Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 354 Joined: 14 Nov 2002 0:01
Post
by Martin Meyer » 10 Mar 2016 21:08
Hello Thomas,
please check the below construction. It compiles and output some number (in VIP 7502).
Many regards
Martin
Code: Select all
domains
t = t( unsigned) .
class predicates
u : ( t, t) procedure ( t( o) , t( o) ) .
clauses
u( X , Y ) :-
X = Y .
clauses
run( ) :-
u( t( A ) , t( A ) ) ,
stdIo:: write ( A ) .
Paul Cerkez
VIP Member
Posts: 108 Joined: 6 Mar 2000 0:01
Post
by Paul Cerkez » 11 Mar 2016 15:15
don't know for sure but it looks like it will just pull what ever is currently store in the memory location for the variable.
Sort of surprised though that you are not getting an 'unbound variable' error at compile time.
AI Rules!
P.
Martin Meyer
VIP Member
Posts: 354 Joined: 14 Nov 2002 0:01
Post
by Martin Meyer » 11 Mar 2016 15:44
Yes, Paul. The intended reaction is probably, that the compiler throws errors "Variable 'X' not completely bound" and "Variable 'Y' not completely bound".
Regards
Martin
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 12 Mar 2016 10:02
That is definitely a bug. We will look at it.
Regards Thomas Linder Puls
PDC
Martin Meyer
VIP Member
Posts: 354 Joined: 14 Nov 2002 0:01
Post
by Martin Meyer » 24 Jul 2016 16:25
Another example, maybe it goes back to the same bug:
Code: Select all
class predicates
p : ( unsigned* ) procedure ( [ o] ) .
clauses
p( _ ) .
clauses
run( ) :-
p( [ X ] ) ,
stdIO:: write ( X ) .
Regards
Martin
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 5 Aug 2016 9:49
This is also a bug. We will look at it.
Regards Thomas Linder Puls
PDC