diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql new file mode 100644 index 00000000..719a9d96 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | |||
@@ -0,0 +1,24 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples | ||
2 | |||
3 | import epackage "FS" | ||
4 | |||
5 | pattern patternContent(o1: FSObject, o2: FSObject) { | ||
6 | Dir.contents(o1,o2); | ||
7 | } | ||
8 | |||
9 | @QueryBasedFeature | ||
10 | pattern live(this: FileSystem, l: FSObject) { | ||
11 | FileSystem.root(this,l); | ||
12 | } or { | ||
13 | FileSystem.root(this,root); | ||
14 | find patternContent+(root,l); | ||
15 | } | ||
16 | |||
17 | @Constraint(key={child}, severity="error", message="error") | ||
18 | pattern contentInNotLive(parent : Dir, child: FSObject) { | ||
19 | Dir.contents(parent,child); | ||
20 | neg find live(_,parent); | ||
21 | } or { | ||
22 | Dir.contents(parent,child); | ||
23 | neg find live(_,child); | ||
24 | } | ||