【发布时间】:2023-04-08 07:01:01
【问题描述】:
我正在使用第一次剪辑来在剪辑中创建基于规则的指南。
(deftemplate personal-data
(slot name)
(slot age)
(slot gender)
(slot personal_history_breast_cancer)
(slot previosly_diagnosed_high-risk_breast_lesion)
(slot genetic_mutation_increase_risk_breast_cancer)
(slot history_exposure_radiation_chest_childhood)
(slot life_expectancy)
)
;add the rules
;R1
(defrule average-risk-women-between-40-and-49
(personal-data (name ?name)
(age ?age)
(gender ?gender)
(personal_history_breast_cancer ?personal_history_breast_cancer)
(previosly_diagnosed_high-risk_breast_lesion ?previosly_diagnosed_high-risk_breast_lesion)
(genetic_mutation_increase_risk_breast_cancer ?genetic_mutation_increase_risk_breast_cancer)
(history_exposure_radiation_chest_childhood ?history_exposure_radiation_chest_childhood))
(and (test (>= ?age 40))
(test (< ?age 49))
(and (test (eq ?gender female))
(and (test (eq ?personal_history_breast_cancer no))
(and (test (eq ?previosly_diagnosed_high-risk_breast_lesion no))
(and (test (eq ?genetic_mutation_increase_risk_breast_cancer no))
(and (test (eq ?history_exposure_radiation_chest_childhood no))))))))
=>
(printout t ?name " should discuss the benefits and risks of breast cancer screening. [1, p. I‐18]" crlf)
)
;R2
(defrule average-risk-women-between-50-and-74
(personal-data (name ?name)
(age ?age)
(gender ?gender)
(personal_history_breast_cancer ?personal_history_breast_cancer)
(previosly_diagnosed_high-risk_breast_lesion ?previosly_diagnosed_high-risk_breast_lesion)
(genetic_mutation_increase_risk_breast_cancer ?genetic_mutation_increase_risk_breast_cancer)
(history_exposure_radiation_chest_childhood ?history_exposure_radiation_chest_childhood))
(and (test (>= ?age 50))
(test (< ?age 74))
(and (test (eq ?gender female))
(and (test (eq ?personal_history_breast_cancer no))
(and (test (eq ?previosly_diagnosed_high-risk_breast_lesion no))
(and (test (eq ?genetic_mutation_increase_risk_breast_cancer no))
(and (test (eq ?history_exposure_radiation_chest_childhood no))))))))
=>
(printout t ?name " should be offered breast cancer screening with a mamogram every 2 years. [1, p. I‐18]" crlf)
)
;R3
(defrule average-risk-women-over-75
(personal-data (name ?name)
(gender ?gender)
(age ?age)
(personal_history_breast_cancer ?personal_history_breast_cancer)
(previosly_diagnosed_high-risk_breast_lesion ?previosly_diagnosed_high-risk_breast_lesion)
(genetic_mutation_increase_risk_breast_cancer ?genetic_mutation_increase_risk_breast_cancer)
(history_exposure_radiation_chest_childhood ?history_exposure_radiation_chest_childhood)
(life_expectancy ?life_expectancy))
(and (test (eq ?gender female))
(or (test (>= ?age 75))
(and (test (eq ?personal_history_breast_cancer no))
(and (test (eq ?previosly_diagnosed_high-risk_breast_lesion no))
(and (test (eq ?genetic_mutation_increase_risk_breast_cancer no))
(and (test (eq ?history_exposure_radiation_chest_childhood no))
(test (<= ?life_expectancy 11))))))))
=>
(printout t ?name " should stop screening for breast cancer. [1, p. I‐18]" crlf)
)
; add facts
; Fact1
(assert (personal-data (name "Maria")
(age 45)
(gender female)
(personal_history_breast_cancer no)
(previosly_diagnosed_high-risk_breast_lesion no)
(genetic_mutation_increase_risk_breast_cancer no)
(history_exposure_radiation_chest_childhood no)))
并收到错误: [ARGACCES5] 函数
[DRIVE1] 在加入网络时出现此错误 问题在于关联连接 规则中的模式 #1 平均风险超过 75 岁的女性
我不知道我做错了什么,谁能救我。
【问题讨论】: