Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 354 Joined: 14 Nov 2002 0:01
Post
by Martin Meyer » 27 Apr 2019 13:34
Hello Thomas,
please have a look at this
predicates from -
supports -
predicates from construction (in build 902):
Code: Select all
interface obj0
predicates
p : ( ) .
end interface obj0
%===
interface obj1
predicates from obj0
p/ 0
end interface obj1
%===
interface obj2 supports obj1
end interface obj2
%===
interface obj3
predicates from obj2
p/ 0 %raises The predicate or property 'p/0' that is specified in predicates
% from/resolve/delegate section is not found in the class or interface 'obj2'
end interface obj3
Regards Martin
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 27 Apr 2019 20:45
predicates from must refer directly to the original declaration of the predicate. So you must write from obj0 .
Regards Thomas Linder Puls
PDC
Martin Meyer
VIP Member
Posts: 354 Joined: 14 Nov 2002 0:01
Post
by Martin Meyer » 27 Apr 2019 22:58
Thank you for the info! In some cases it works however to not refer to the original declaration:
Code: Select all
interface obj0
predicates
p : ( ) .
end interface obj0
%===
interface obj1
predicates from obj0
p/ 0
end interface obj1
%===
interface obj2
predicates from obj1
p/ 0
end interface obj2
I would vote for that in future versions you make it work out in all cases.
Regards Martin
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 28 Apr 2019 17:21
Yes, I was inaccurate. It must point to an interface that contains a relevant declaration.
Regards Thomas Linder Puls
PDC
Martin Meyer
VIP Member
Posts: 354 Joined: 14 Nov 2002 0:01
Post
by Martin Meyer » 28 Apr 2019 21:30
This works too:
Code: Select all
interface obj0
predicates
p : ( ) .
end interface obj0
%===
interface obj1 supports obj0
end interface obj1
%===
interface obj2 supports obj1
end interface obj2
%===
interface obj3
predicates from obj2
p/ 0
end interface obj3
But that does not:
Code: Select all
interface obj0
predicates
p : ( ) .
end interface obj0
%===
interface obj1
predicates from obj0
p/ 0
end interface obj1
%===
interface obj2
predicates from obj1
p/ 0
end interface obj2
%===
interface obj3
predicates from obj2
p/ 0 %raises exception
end interface obj3
Regards Martin
Thomas Linder Puls
VIP Member
Posts: 1466 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 30 Apr 2019 8:35
Well, I guess we better look at this.
Regards Thomas Linder Puls
PDC