我有一个非常令人费解的问题。我似乎找不到这个谓词的实例。下面是代码。
module keyless
open util/ordering[state] as trace
abstract sig ownerpostype{}
//owner is out and far away from the car
//this set should be mapped to person
one sig far extends ownerpostype{} //{(far)}
one sig near extends ownerpostype{} //{(near)}
one sig insidecar extends ownerpostype{} //{(insidecar)}
//engine status
abstract sig enginetype{}
one sig on extends enginetype{} //engine is on
one sig off extends enginetype{}
//car door status
abstract sig dooroptype{}
one sig unlock extends dooroptype{}
one sig lock extends dooroptype{}
one sig opened extends dooroptype{}
//car status
abstract sig motortype{}
one sig moving extends motortype{}
one sig still extends motortype{}
//key fob position
abstract sig keypostype{}
one sig incar extends keypostype{} //key fob in car
one sig faralone extends keypostype{}
one sig pocket extends keypostype{}
sig state{
owner: ownerpostype, //(s, far) or (s,near) or (s, insideCar)
//engine: enginetype,
door: dooroptype,
//motor: motortype,
//key: keypostype
}
//initial state
pred init (s: state){
//engine intially off
s.door in lock and s.owner in far
}
//operations on the owners position
pred towards (s, s' : state){
s.owner in far and s'.owner in near and s.door = s'.door
}
//operations on key position
pred getin (s, s' : state){
s.owner in near
s.door in opened
s'.door = s.door
s'.owner in insidecar
}
//operations on door status
pred unlockopen (s, s' : state){
s.owner in near and s.door in lock
s'.door in opened
s'.owner = s.owner
}
pred close (s, s' : state){
s.door in opened and s'.door in unlock
s'.owner = s.owner
}
fact {
first.init
all t : state - last | let t' = t.next |
towards[t, t'] or getin[t, t'] or unlockopen[t, t']
}
run getin
为什么 getin 没有实例?我已经跟踪了代码,基本的跟踪应该是这样的:init -> 朝向 -> unlockopen -> getin。
这些前面的谓词中的每一个都应该满足后续谓词中的约束。那么,为什么我可以获得除 getin 之外的其余谓词的实例?
非常感谢对此的一些指导。