I have a really puzzling question. I can't seem to find an instance for this predicate. Below is the code.
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
Why can't getin have an instance? I have traced the code, and the basic trace should follow like this: init -> towards -> unlockopen -> getin.
Each of these preceding predicates should fulfil the constraints in the succeeding predicate. So why can I get an instance for the rest of the predicates except getin?
Would really appreciate some guidance on this.