-
Notifications
You must be signed in to change notification settings - Fork 1
/
scratch.pol
65 lines (50 loc) · 943 Bytes
/
scratch.pol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
a1 = activity(:play) { true }
a2 = activity(:record) { true }
a3 = activity(:stop) { true }
c1 = constraint { true }
c2 = constraint { |c| true }
c3 = constraint { |c, a| true }
ra1 = restrict a1 do
with c1q
end
ra2 = restrict a2 do
with c2, c3
end
ra3 = restrict a3 do
with c1, c3
end
ra4 = restrict a1, a3 do
with c1, c2, c3
end
ra5 = restrict a3 do
with c1, c3
end
ra6 = restrict a1, a3 do
with c1, c2, c3
end
p_cc = policy do
policy_evaluators :lamport, :temporal
constraint_evaluators :predicate
permit_when ra1, ra3, ra5
permit :when => [ra1, ra3, ra5]
permit do
when ra1, ra3, ra5
end
|| [ra1, ra2]
obligate ra1, :with => ra2
obligate ra2, ra3, :with => [ra5, ra6]
obligate ra1 do
with ra2
end
obligate ra2, ra3 do
with ra5, ra6
end
end
p_cc = policy do
policy_evaluator :cc
end
p_xrml = policy do
policy_evaluator :xrml
end
cc_2_xrml_out = p_cc.xrml
xrml_2_cc_out = p_xrml.cc