Discussions related to Visual Prolog
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Domain and Fact Naming Conflict (VIP 7.4 vs 5.2)

Unread post by Harrison Pratt »

In VIP 5.2 it was possible to have a domain defined with the same structure as a fact, as in (1) below. In 7.5 the compiler complains "The declaration conflicts with another declaration of 'test/2' in the scope."

Is there some way to declare a domain with the same name & structure as a fact, or must I use (2) strategy below?

Code: Select all

domains         testDom = test( string, string ).    % (1) Causes declaration conflict     % testDom = testDom(string,string). % (2) No error   class facts     test : ( string, string ).   class predicates     process : ( testDom ). clauses     process( TD ):-         TD = testDom(S1,S2),         % TD = test(S1,S2),         stdio::write( S1, "\t", S2 ).
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

You will have to use strategy (2), when the names are in the same class.
Regards Thomas Linder Puls
PDC
Post Reply