reverse engineering - Alloy traces and projection issues -
i find difficult understand way traces , projections work in alloy. cannot desirable results.
in following example try project on course , see how students enrolling, seems never have relation.
when use normal view (without projection) multiple solutions fine.. want know way (step-by-step) of how created using traces (trace back).
open util/ordering[course] sig student {} sig course { roster : set student } pred enroll (c, c' : course, snew : student) { c'.roster = c.roster + snew } pred init(c: course) { no c.roster } fact traces { init[first] c: course - last | let c' = next[c] | s: student | enroll[c, c', s] } pred show {} run show 5
i'm not sure of try accomplish. think notion of time missing in model. have roster given course changing on time concept.
it seems bypassed "good practice" directly ordering course concept, guess want first course have no student, second course have new 1 etc .... (which doesn't make sense nvm).
i guess source of disappointment when make projection on course, expect see number of students in course roster varying when go course course, , not happening.
the reason when write s: student | enroll[c, c', s] expect s totally new, while means there's @ least one. suggest write instead : s: student | s not in c.roster , enroll[c, c', s]
Comments
Post a Comment