Reputation: 3412
I wrote the following code in Alloy. I was wondering why it doesn't find an instance since there are no facts at all in code.
abstract sig TaskStatus {}
one sig Completed extends TaskStatus {}
one sig Waiting extends TaskStatus {}
one sig OnGoing extends TaskStatus {}
sig Capability {}
sig Task {
status: one TaskStatus,
precondition: set Task,
capability: one Capability
}
sig Agent {
tasks: set Task,
capabilities: set Capability
}
sig ToDoList {
tasks: set Task
}
pred show {
some Capability
some Agent
some ToDoList
#Task > 3
}
run show
Upvotes: 0
Views: 115
Reputation: 3867
run
command#Task > 3
is not satisfiable in that scopeIf you run your original model, with verbosity set at least to "medium", you should see something like this in the console window on the right-hand side
Executing "Run show"
Sig this/Completed scope <= 1
Sig this/Waiting scope <= 1
Sig this/OnGoing scope <= 1
Sig this/TaskStatus scope <= 3
Sig this/Capability scope <= 3
Sig this/Task scope <= 3
Sig this/Agent scope <= 3
Sig this/ToDoList scope <= 3
confirming that the scope for Task
was indeed by default set to 3.
To fix the problem, specify a larger scope, e.g.,
run show for 5
Upvotes: 1