有没有办法只允许CLIPS中的插槽使用唯一值

时间:2017-09-04 05:27:04

标签: oop clips expert-system

(deftemplate Employee
   (slot employee-id)
   (slot employee-name)
   (slot Role)
   (slot Designation))

(deffacts Employees
   (employee (employee-name X) (employee-id 1) (Role CS) (Designation TA))
   (employee (employee-name Y) (employee-id 2) (Role CS) (Designation SA))
   (employee (employee-name Z) (employee-id 3) (Role CIS) (Designation TA))
   (employee (employee-name W) (employee-id 4) (Role SE) (Designation SA))
   (employee (employee-name Q) (employee-id 5) (Role CIS) (Designation TA))
   (employee (employee-name U) (employee-id 1) (Role CS) (Designation TA)))

在上面的例子中,我输入了两次员工ID。如何将员工ID定义为唯一?

1 个答案:

答案 0 :(得分:0)

$1