Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 330 Joined: 14 Nov 2002 0:01
Unread 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: 106 Joined: 6 Mar 2000 0:01
Unread 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: 330 Joined: 14 Nov 2002 0:01
Unread 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
Martin Meyer
VIP Member
Posts: 330 Joined: 14 Nov 2002 0:01
Unread 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