I am totally new to this side of the programming world but very interested. I am trying to get my hands dirty so to speak by modeling system that associates papers by the search strategy used to originally retrieve the papers.
Toy-ness aside, I am having trouble generating instances based on an empty initial state. Below is the code that I have so far. Running with no system predicate, alloy is able to generate seemingly arbitrary instances however. Could someone help me diagnose the problem with the model I have written?
Thanks in advance!
sig SearchStrategy {
strat: Strat,
version: Int,
var papers: some Paper
}
sig Strat {}
sig Paper {
pmid: PID,
var searchStrats: some SearchStrategy,
var field: set Field,
}
sig PID {}
abstract sig Field {}
sig Author extends Field {
name: String
}
pred add_paper[p: Paper] {
-- preconditions
not (p in SearchStrategy.papers)
-- postconditions
Paper' = Paper + p
SearchStrategy.papers' = SearchStrategy.papers + p
}
pred init {
no Paper
no SearchStrategy
}
// Transitions
pred trans {
(some p: Paper | add_paper[p])
}
// Denotes all possible executions of the system from an initial condition state
pred System {
init
always trans
}
run { System } for 5