Problem with Must-Unify

Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 275
Joined: 14 Nov 2002 0:01

Problem with Must-Unify

Unread post by Martin Meyer » 28 Oct 2014 18:15

Hi Thomas,

please check this construction, the compiler (build 7500) has a problem with it:

Code: Select all

domains     record{Type} =         empty;         node(Type Item).   class predicates     compareRecord : (comparator{Type} CompareItem)         -> comparator{record{Type}} CompareRecord. clauses     compareRecord(CompareItem) =             { (RecordA, RecordB) = CompareItem(ItemA, ItemB) :-                 node(ItemA) == RecordA,                 node(ItemB) == RecordB             }.   clauses     run() :-         _ = compareRecord(compare).
When replacing the Must-Unifiy, it works fine:

Code: Select all

domains     record{Type} =         empty;         node(Type Item).   class predicates     compareRecord : (comparator{Type} CompareItem)         -> comparator{record{Type}} CompareRecord. clauses     compareRecord(CompareItem) =             { (RecordA, RecordB) = CompareItem(ItemA, ItemB) :-                 if                     node(ItemA) = RecordA,                     node(ItemB) = RecordB then                 else                     exception::raise_error()                 end if             }.   clauses     run() :-         _ = compareRecord(compare).
Regards
Martin

User avatar
Thomas Linder Puls
VIP Member
Posts: 2422
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 28 Oct 2014 21:51

Thank you we will look at it.
Regards Thomas Linder Puls
PDC

User avatar
Thomas Linder Puls
VIP Member
Posts: 2422
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 8 Dec 2014 10:16

This is fixed in Visual Prolog 7.5 Build 7501.

Select Web -> Check for Updates in the IDE to updated to the latest version.
Regards Thomas Linder Puls
PDC

Post Reply