<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Student.als</title><link>https://sourceforge.net/p/alloymda/wiki/Student.als/</link><description>Recent changes to Student.als</description><atom:link href="https://sourceforge.net/p/alloymda/wiki/Student.als/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 20 Mar 2012 18:09:14 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/alloymda/wiki/Student.als/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Student.als modified by Alcino Cunha</title><link>https://sourceforge.net/p/alloymda/wiki/Student.als/</link><description>~~~~~~
module Student

sig Time {}

sig Name {}

fact { all n : Name | lone name.n }

sig Course {
	labs : some Lab
}

sig Lab {}

fact { all l : Lab | lone labs.l }

enum Grade { A,B,C,D,E }

sig Student {
	name : one Name,
	approved : Course -&gt; Time,
	current : Course lone -&gt; Time,
	donelabs : Lab -&gt; Time,
	exams : Course -&gt; Grade lone -&gt; Time
}

fact { all t : Time | all s : Student | s.current.t not in s.approved.t }

fact { all t : Time | all s : Student | all c : s.approved.t | 
	c.labs in s.donelabs.t and c.(s.exams.t) in A+B+C+D
}

fact { all t : Time | all s : Student | 
	(s.current.t + s.approved.t + (s.exams.t).Grade) in ((students.t).s).courses 
}

sig College {
	students : Student -&gt; Time,
	courses : set Course
}

fact { all t : Time | all s : Student | one (students.t).s }

run {} for 4 but exactly 1 Student, exactly 1 Time

pred newstudent [c : College, s : Student, t,t' : Time] {
	no (students.t).s
	no s.approved.t
	no s.current.t
	no s.donelabs.t
	no s.exams.t

	students.t' = students.t + c -&gt; s
}

pred enroll [s : Student, c : Course, t,t' : Time] {
	no s.current.t
	c not in s.approved.t
	
	current.t' = current.t + s -&gt; c
}

pred lab [s : Student, l : Lab, t,t' : Time] {
	some s.current.t
	l not in (s.donelabs.t)
	l in (s.current.t).labs

	donelabs.t' = donelabs.t + s -&gt; l
}

pred exam [s : Student, g : Grade, t,t' : Time] {
	some s.current.t
	s.current.t not in (s.exams.t).Grade

	exams.t' = exams.t + s -&gt; s.current.t -&gt; g
}

pred approve [s : Student, t,t' : Time] {
	some s.current.t
	(s.current.t).(s.exams.t) in A+B+C+D
	(s.current.t).labs in s.donelabs.t

	approved.t' = approved.t + s -&gt; s.current.t
	current.t' = current.t - s -&gt; Course
}

pred quit [s : Student, t,t' : Time] {
	some s.current.t
	
	exams.t' = exams.t - s -&gt; s.current.t -&gt; Grade
	donelabs.t' = donelabs.t - s -&gt; (s.current.t).labs
	current.t' = current.t - s -&gt; Course
}
~~~~~~</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcino Cunha</dc:creator><pubDate>Tue, 20 Mar 2012 18:09:14 -0000</pubDate><guid>https://sourceforge.net500b5ac5c205e29bc5e2d4b39b340272d647048a</guid></item></channel></rss>