0
我已經經歷了一個問題陳述,如: 外科醫生必須對三名患者進行手術,但只有兩副手套。交叉污染必須不存在:外科醫生不得接觸任何患者的血液,並且患者不得接觸另一位患者的血液。外科醫生需要兩隻手才能工作。她是如何做到的?在Alloy中表達這個問題,並使用分析器找到解決方案。合金事實宣言
我已經decalared幾個簽名,但我堅持需要事實和謂詞的聲明。誰能幫我嗎?我的代碼是:
module Question1
sig Doc_Patient {
doc : one Surgeon,
patient: set Patient,
relation1: doc one->one Hand,
//relation2: hand one->set Gloves
//relation3:
}
sig Surgeon{
//hands: one Hand,
blood1: one Blood
}
sig Blood { }
one sig Hand {
material: set Gloves
}
sig Gloves { }
sig Patient {
blood2: one Blood
}
fact {
}
pred show(){ }
run show for 1 Doc_Patient,1 Surgeon,1 Hand,4 Blood,3 Patient,2 Gloves
\ thanx提前