现在客户有两种选择,电话和短信到诊所预约医生。电话或短信需要发送给话务员或接待处,然后进行下一步....众所周知,电话和短信可以发送成功或发送失败,发送失败的解决方案将继续重试相同的用户选择方式或另一种方式。
基于以上背景,我写了一些做模型检查行为的代码来实现它。我是班上的新手,任何人都可以帮助找出我的代码有什么问题。
MODULE call
VAR
option:{call,sms};
call:{successful,fail,again};
sms:{successful,fail,again};
phone_attender:{available,unavailable};
ASSIGN
init(option):=call|sms;
next(call):=case
call=successful:successful;
call=successful&phone_attender=available:{successful,available};
call=fail&phone_attender=fail:{fail,unavailable};
call=fail&phone_attender=fail:{again,unavailable};
call=again&phone_attender=successful:{again,available};
1:{successful,fail,again};
esac;
next(sms):=case
sms=successful&phone_attender:successful{successful};
sms=fail&phone_attender=fail:{fail,unavailable};
sms=fail&phone_attender=fail:{again,unavailable};
sms=again&phone_attender=successful:{again,available};
1:{successful,fail,again};
next(phone_attender):=case
phone_attender=available(call=successful|call=again)&(sms=successful|sms=again);
phone_attender=unavailable(call=fail|call=again)&(sms=fail|sms=again);
1:phone_attender;
esac;
它总是给我留下语法错误,并使用 nuXmv 在终端中运行。