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

Some minor details in VIP 11 build 1111

Post by Martin Meyer »

I have moved my code from VIP 9.0.6 to 11 build 1111. The upgrade worked fine. Just a few little things, most of them old, that you might find worth a look:

1) This syntax is not accepted anymore:

Code: Select all

class predicates     difference_discriminate : (dictionary{Key, DataA} DictionaryA, dictionary{Key, DataB} DictionaryB) -> dictionary{Key, DataA} DictionaryAB         language prolog as "mfc_uRdxTree_differenceTree"     where Key supports unsigned. % Compiler throws a syntax error here       difference_discriminate : (dictionary{Key, Data} DictionaryA, uRdxSet::dictionary{Key} SetB) -> dictionary{Key, Data} DictionaryAB         language prolog as "mfc_uRdxTree_differenceSet"     where Key supports unsigned.
2) In 32bit mode this code

Code: Select all

domains     dictionary{Key} = leaf(Key).   class predicates     doNothing : (dictionary{Key} Dict) -> dictionary{Key} NewDict         where Key supports unsigned64. clauses     doNothing(leaf(K)) = doNothing_1(K).   class predicates     doNothing_1 : (Key) -> dictionary{Key} Dict         where Key supports unsigned64. clauses     doNothing_1(K) = leaf(K).   %====== clauses     run() :-         Dict_0 = leaf(0),         stdIo::write("1> ", Dict_0, "\n"),         Dict_1 = doNothing(Dict_0),         stdIo::write("2> ", Dict_1, "\n").
outputs

Code: Select all

1> leaf(0) 2> leaf(4878816)
(cf. Bounded polymorphism problem).

3) The compiler dumps on this (cf. Generic property problem):

Code: Select all

interface myObject{@Type}     open core   properties     value : @Type.   properties     create : function{myObject{LocalType}} (o).   end interface myObject   %---   class myObject{@Type} : myObject{@Type} end class myObject   %---   implement myObject{@Type}   facts     value : @Type := erroneous.   clauses     create() = myObject{LocalType}::new.   end implement myObject   %===   implement main     open core   clauses     run() :-         StringObj = myObject{string}::new(),         IntegerObj = StringObj:create(),         IntegerObj:value := -3.
4) This code

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]).
outputs

Code: Select all

not unfiable
(cf. List unification problem).

5) Following code issues error c229 (cf. Optional parameters):

Code: Select all

domains     unsigned3Enumerator = (unsigned A [out], unsigned B [out], unsigned C [out]) nondeterm.   class predicates     enum : unsigned3Enumerator. clauses     enum(1, 2, 3).     enum(4, 5, 6).   clauses     run() :-         List = [ A || enum(A, _B) ], %error c229 : Undeclared identifier 'enum/2', the identifier is known as 'enum/3'         stdIO::write(List).
6) The compiler dumps on this code in 64bit mode:

Code: Select all

class predicates     tryPop : (Type* Stack, Type Top [out]) -> Type* Stack1 determ. clauses     tryPop([Head | Tail], Head) = Tail.   class predicates     discardTop : (integer* Stack) -> integer* RestStack. clauses     discardTop(Stack) = tryPop(Stack) otherwise exception::raise_error("Cannot discard top of empty stack"). %fatal error c098
7) The compiler complains about a flow pattern in this code (cf. Problem picking a predicate of certain arity):

Code: Select all

interface rule end interface rule   %===   interface grammar     [presenter]   predicates     getRule_nd : () -> rule nondeterm.   predicates     getRule_nd : (symbol Head) -> rule nondeterm.   end interface grammar   %===   interface grammarSupportSite   predicates from grammar     getRule_nd/0->   end interface grammarSupportSite   %===   interface grammarSupport     [presenter]   predicates from grammar     getRule_nd/1->   end interface grammarSupport   %---   class grammarSupport : grammarSupport   constructors     new : (grammarSupportSite Site).   end class grammarSupport   %---   implement grammarSupport   facts     grammarSite : grammarSupportSite.   delegate     interface grammarSupportSite to grammarSite   clauses     new(Site) :-         grammarSite := Site.   clauses     getRule_nd(_Head) = _Rule :-         fail.   clauses     presenter() = presenter::mkPresenter_set(getRule_nd). % Throws error c603 : The flow pattern '()' does not exist for 'grammarSupport::getRule_nd/1->'   end implement grammarSupport
Regards Martin
User avatar
Thomas Linder Puls
VIP Member
Posts: 1466
Joined: 28 Feb 2000 0:01

Re: Some minor details in VIP 11 build 1111

Post by Thomas Linder Puls »

Thank you we will look into the problems.
Regards Thomas Linder Puls
PDC
User avatar
Thomas Linder Puls
VIP Member
Posts: 1466
Joined: 28 Feb 2000 0:01

Re: Some minor details in VIP 11 build 1111

Post by Thomas Linder Puls »

These problems are solved in Visual Prolog 11 build 1112
Regards Thomas Linder Puls
PDC