Page 1 of 1

Problem with Must-Unify

Posted: 28 Oct 2014 18:15
by Martin Meyer
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

Posted: 28 Oct 2014 21:51
by Thomas Linder Puls
Thank you we will look at it.

Posted: 8 Dec 2014 10:16
by Thomas Linder Puls
This is fixed in Visual Prolog 7.5 Build 7501.

Select Web -> Check for Updates in the IDE to updated to the latest version.