aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql
blob: 719a9d963d4eae45011cf4fdadf035eaff2a9e00 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package hu.bme.mit.inf.dslreasoner.domains.alloyexamples

import epackage "FS"

pattern patternContent(o1: FSObject, o2: FSObject) {
	Dir.contents(o1,o2);
}

@QueryBasedFeature
pattern live(this: FileSystem, l: FSObject) {
	FileSystem.root(this,l);
} or {
	FileSystem.root(this,root);
	find patternContent+(root,l);
}

@Constraint(key={child}, severity="error", message="error")
pattern contentInNotLive(parent : Dir, child: FSObject) {
	Dir.contents(parent,child);
	neg find live(_,parent);
} or {
	Dir.contents(parent,child);
	neg find live(_,child);
}