Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 358 Joined: 14 Nov 2002 0:01
Post
by Martin Meyer » 8 Oct 2025 20:41
Hello Thomas,
please check this case (in VIP build 1112):
Code: Select all
class predicates
test : ( unsigned*, unsigned* ) .
clauses
test( As , Bs ) :-
if [ [ As , [ X ] ] ] = [ [ [ X ] , Bs ] ] then
stdIO:: write ( "unifies" )
else
stdIO:: write ( "not unfiable" )
end if .
clauses
run( ) :-
test( [ 1 ] , [ 1 ] ) .
It outputs "not unifiable".
Regards Martin
sbishop61
Posts: 20 Joined: 9 May 2021 9:55
Post
by sbishop61 » 10 Oct 2025 12:33
I may be missing the logic you are implementing/testing.
If it unification based on there being a list X that when appended to A gives the same list prefixed to B; then the following 'works':
Code: Select all
test( As , Bs ) :-
if [ As , [ X ] ] = [ [ X ] , Bs ] then
stdIO:: write ( "unifies" )
else
stdIO:: write ( "not unfiable" )
end if .
If I am misunderstanding, my apologies.
Martin Meyer
VIP Member
Posts: 358 Joined: 14 Nov 2002 0:01
Post
by Martin Meyer » 10 Oct 2025 15:56
You are not misunderstanding. My code contains unnecessary complications and can be simplified.
I am reporting the example only to contribute to the perfection of the compiler. The compiler is a magnificent technical masterpiece, it is desirable to eliminate any bug.
Regards Martin
Thomas Linder Puls
VIP Member
Posts: 1483 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 21 Oct 2025 8:29
Thank you Martin, we will of course investigate this problem.
Regards Thomas Linder Puls
PDC