Page 1 of 1

Domains and Facts How to

Posted: 29 Dec 2015 18:44
by kingchris
I believe that I was asleep during the Domains and Facts lecture so here is a simple question.

Code: Select all

class bt_class : bt_class     open core   predicates     classInfo : core::classInfo.     % @short Class information  predicate.     % @detail This predicate represents information predicate of this class.     % @end   domains     parcel_info = parcel_info(integer Nearest, real Distance).     parcel_info_list = parcel_info*.         gift_pos =  gift(integer ID,real Lat,real Log,real Weight,   real Distance).     gift_pos_list = gift_pos* .       gift_and_neighbours = gift_and_neighbours(integer ID ,gift_pos_list).     segment = segment(integer ID, core::integer_list Links, real T_weight).   constructors         new:() .

Code: Select all

implement bt_class     open core   constants     className = "bt_class/bt_class".     classVersion = "".       gift_location = "gift_location".     nearest_location = "nearest_location".       segment_location = "segment_location".   domains     giftD   =   gift1(integer,real,real,real,real).   class facts-gifts    gift:(integer,real,real,real,   real).    gift_nearest:(integer ID,integer Nearest).   class facts-neighbours    gift_and_neighbours:(integer ID, parcel_info_list).   class facts-segments segment(xxxxxxxxxxxxxxx)  ????????
Here we have the .CL and .PRO head of a class that I am building.
In the .CL file I have a domain

Code: Select all

    segment = segment(integer ID, core::integer_list Links, real T_weight).
Is there a way in the .PRO file to use this domain declaration to create a class fact called segment?

Code: Select all

class facts-segments segment(xxxxxxxxxxxxxxx)  ????????
For all other class facts I have duplicated the definition for now.