/* ******************* METRIC REFERENTS ************************ */ /* 'supp_match' find the support for the matching of two i-types. If the value is unspecified in G1, this will unify with any referent in G2 with support (1 1). However, an unspecified value in G2 will unify with any referent in G1 with support (0 1). When both values are specified, the built-in predicate "match" is used to find the support for the unification */ ((supp_match '??' _ (1 1) )) ((supp_match _ '??' (0 1) )) ((supp_match I1 I2 (N P) ) (supp_query ((match I1 I2)) (N P) )) /* 'gen_concept' generates a new concept by unifying the referents of the two source concepts, and generating a new i-type, unless there is no support for the join */ ((gen_concept 0 _ _ _ _ nil nil nil)) ((gen_concept _ T1 V1 T2 V2 T3 V3 I3) (gen_ref T1 V1 T2 V2 T3 V3) (gen_itype T3 V3 I3)) /* 'gen_ref' generates the referent resulting from the unification of two concepts. It is only used when the two concepts "match" with positive support, so no conditional checking is required */ ((gen_ref '??' _ T2 V2 T2 V2)) ((gen_ref T1 V1 '??' _ T1 V1)) ((gen_ref '=' V1 _ _ '=' V1)) ((gen_ref _ _ '=' V2 '=' V2)) ((gen_ref '>=' V1 '>=' V2 '>=' V3) (max V1 V2 V3)) ((gen_ref '<=' V1 '<=' V1 '<=' V3) (min V1 V2 V3)) ((gen_ref '~' V1 '~' V2 '..' V3) (end_points V1 V4) (end_points V2 V5) (overlap V4 V5 V3)) ((gen_ref '~' V1 T2 V2 '..' V3) (end_points V1 V4) (interval T2 V2 V5) (overlap V4 V5 V3)) ((gen_ref '~' V1 _ _ '~' V1)) ((gen_ref T1 V1 '~' V2 '..' V3) (end_points V2 V4) (interval T1 V1 V5) (overlap V4 V5 V3)) ((gen_ref _ _ '~' V2 '~' V2)) ((gen_ref '<=' V1 '>=' V2 '..' (V2 V1) )) ((gen_ref '>=' V1 '<=' V2 '..' (V1 V2) )) ((gen_ref '..' (V1 V2) '>=' V3 '..' (V4 V2)) (max V1 V3 V4)) ((gen_ref '..' (V1 V2) '<=' V3 '..' (V1 V4)) (min V2 V3 V4)) ((gen_ref '>=' V1 '..' (V2 V3) '..' (V4 V1)) (max V1 V2 V4)) ((gen_ref '<=' V1 '..' (V2 V3) '..' (V2 V4)) (min V1 V3 V4)) ((gen_ref '..' (V1 V2) '..' (V3 V4) '..' (V5 V6)) (min V1 V3 V5) (max V2 V4 V6)) /* 'end_points' succeeds with the +/-20% end points of a fuzzy value */ ((end_points V (V1 V2)) (times V 0.8 V1) (times V 1.2 V2)) /* 'interval' converts an i-type '<=' or '>=' into an interval */ ((interval '..' V V)) ((interval '<=' V (-10000 V))) ((interval '>=' V (V 10000))) /* 'overlap' succeeds if the two specified intervals overlap, and returns the range of overlap */ ((overlap (V1 V2) (V3 V4) (V3 V4)) (less V1 V3) (less V4 V2)) ((overlap (V1 V2) (V3 _) (V3 V2)) (less V1 V3) (less V3 V2)) ((overlap (V1 V2) (_ V4) (V1 V4)) (less V1 V4) (less V4 V2)) /* 'gen_itype' generates the i-type corresponding to the referent formed from unifying two numeric referents. Note 'gen_interval' and 'add_i' defined in program 'unify' */ ((gen_itype '=' V V)) ((gen_itype '??' _ 0)) ((gen_itype '..' (V1 V2) _I_type) (gen_interval (V1 V2) _I_type)) ((gen_itype _R_type V _I_type) (add_i _R_type _RI_type) (times _RI_type V _I_type)) ((max N1 N2 N1) (less N2 N1) (!)) ((max _ N2 N2)) ((min N1 N2 N1) (less N1 N2) (!)) ((min _ N2 N2)) /* *************************************************************** */