我是 Event-B 的初学者,我正在尝试建模一台机器,其中集合 PERSONNE 包含集合 CLIENT,集合 CLIENT 包含集合 RESIDENT ...我已经搜索了罗丹的文档,但我没有找到任何东西。 . 这是上下文
context contexteHumain
sets PERSONNE CLIENT RESIDENT
axioms
@axm1; finite(PERSONNE)
@axm2; finite(CLIENT)
@axm3; finite(RESIDENT) // Definition of three possible sets
这是机器
machine machineFunKeyHotel sees contexteHumain
variables
pers
reserv
cli
resid
chkin
chkout
invariants
@inv1: pers ⊆ PERSONNE
@inv2: cli ⊆ CLIENT
@inv3: resid ⊆ RESIDENT
// Définis les 3 variables d'ensemble de Personnes, Clients et Résidents
@inv4: reserv ∈ BOOL
@inv5: chkin ∈ BOOL
@inv6: chkout ∈ BOOL
// Les paramètres booléens si la ⦂personne a réservé, check-in ou check-out.
@inv7: CLIENT ⊆ PERSONNE
@inv8: RESIDENT ⊆ CLIENT
// Et les relations entre les différnets ensembles d'humains·
events
event INITIALISATION
begin
@act1: reserv ≔ FALSE
@act2: chkin ≔ FALSE
@act3: chkout ≔ FALSE
// Ces valeurs sont à faux, en effet, au début personne n'a ni réservé ni check-in
// Encore moins check out.
@act4: resid ≔ ∅
@act5: cli ≔ ∅
// Au début le nombre de client et de résidents sont zéro
@act6: pers ≔ ∅ //???
// Définir un nombre de personne presqu'infini (Personnes sur terre estimé à
// 7 290 477 807 personnes le vendredi 3 avril 2015 à 9 h 07 min et 24 s (GTM +1)
end
event réserver
// Lorsqu'une personne quelconque a réservé ça implique quelle soit ajoutée
// à l'ensemble clients.
any potentiel_client
where
@gr1: potentiel_client ∈ PERSONNE
@gr2: reserv = TRUE
then
@act1: cli ≔ cli ∪ {potentiel_client}
end
event checkerin
// Lorsqu'un client a passé l'étape de check-in, cela implique qu'il est ajouté
// à l'ensemble résident
any futur_resident
where
@gr1: futur_resident ∈ CLIENT
@gr2: chkin = TRUE
then
@act1: resid ≔ resid ∪ {futur_resident}
end
event checkerout
// Lorsqu'un résident a procédé au check out cela implique qu'il est retiré
// et de l'ensemble client et de l'ensemble résident.
any resident_actuel
where
@gr1: resident_actuel ∈ RESIDENT
@gr2: chkout = TRUE
then
@act1: resid ≔ resid ∖ {resident_actuel}
@act2: cli ≔ cli ∖ {resident_actuel}
end
end
我想我有这个想法,但我无法解决我得到的各种错误:类型 CLIENT 和 PERSONNE 不匹配(3 次) 类型 RESIDENT 和 CLIENT 不匹配(2 次)......