<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to FileSystem.als</title><link>https://sourceforge.net/p/alloymda/wiki/FileSystem.als/</link><description>Recent changes to FileSystem.als</description><atom:link href="https://sourceforge.net/p/alloymda/wiki/FileSystem.als/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 20 Mar 2012 18:08:31 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/alloymda/wiki/FileSystem.als/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage FileSystem.als modified by Alcino Cunha</title><link>https://sourceforge.net/p/alloymda/wiki/FileSystem.als/</link><description>~~~~~
module FileSystem

sig Time {}

abstract sig Object {
	name : Name,
	parent : Dir lone -&gt; Time
}

sig Dir, File extends Object {}

sig FileSystem {
	objects : Object -&gt; Time,
	root : Dir one -&gt; Time,
	wd : Dir one -&gt; Time
}

sig Name {}

fact { all t : Time | all x : Object | all y : x.(parent.t).~(parent.t) - x | x.name not in y.name }

fact { all t : Time | all o : Object | o not in o.^(parent.t) }

fact { all t : Time | all fs : FileSystem | fs.(root+wd).t in fs.objects.t }

fact { all t : Time | all fs : FileSystem | all o : fs.objects.t | o.parent.t in fs.objects.t }

fact { all t : Time | all fs : FileSystem | fs.objects.t in *(parent.t).(fs.root.t) }


run {} for 4 but exactly 1 Time, exactly 1 FileSystem

fun ls [fs : FileSystem,t:Time] : set Object {
	(parent.t).(fs.wd.t) &amp; fs.objects.t
}

pred rm [fs : FileSystem, f : File, t,t' : Time] {
	f in ls[fs,t]
	fs.objects.t' = fs.objects.t - f
	fs.root.t' = fs.root.t
	fs.wd.t' = fs.wd.t
}

pred cd [fs : FileSystem, d : Dir, t,t' : Time] {
	d in fs.objects.t
	fs.wd.t' = d
	fs.objects.t' = fs.objects.t
	fs.root.t' = fs.root.t
}

run rm for 4 but 1 FileSystem, 2 Time
~~~~~</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcino Cunha</dc:creator><pubDate>Tue, 20 Mar 2012 18:08:31 -0000</pubDate><guid>https://sourceforge.net3aaaa741e1fd56255dd7f30db5c94b80664cc780</guid></item></channel></rss>