Discussions related to Visual Prolog
jarnold30
Posts: 19
Joined: 9 Aug 2020 15:30

how to implement properties using facts

Unread post by jarnold30 »

Hi, I'm trying to implement a property using a fact.

I have a line in task.cl:

Code: Select all

properties     preConditions : setM{cond}.
I have a line in task.pro:

Code: Select all

facts     preConditions : setM{cond}.
But I'm getting an error e264.
User avatar
Gukalov
VIP Member
Posts: 62
Joined: 5 Oct 2011 15:16

Re: how to implement properties using facts

Unread post by Gukalov »

Unfortunately, up to now I have learnt only first 263 errors.
I have not learnt yet the error number 264 - I'm very sorry.

But:
1. The properties is in the class, so the corresponding fact must be in class facts section.
2. Will be not bad to set any init value.

Code: Select all

class facts     preConditions : setM{cond} := setM_redBlack::new().
jarnold30
Posts: 19
Joined: 9 Aug 2020 15:30

Re: how to implement properties using facts

Unread post by jarnold30 »

OK, I know it works if I convert the fact to a class fact. But I want an object property not a class property.
User avatar
Gukalov
VIP Member
Posts: 62
Joined: 5 Oct 2011 15:16

Re: how to implement properties using facts

Unread post by Gukalov »

So why you put the propertie declaration in the CLASS?!)))
Put it in the INTERFACE...
jarnold30
Posts: 19
Joined: 9 Aug 2020 15:30

Re: how to implement properties using facts

Unread post by jarnold30 »

aha!
Thanks very much
Post Reply