-
Notifications
You must be signed in to change notification settings - Fork 2
/
safe.slang
48 lines (38 loc) · 1.36 KB
/
safe.slang
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
//
// Identity set (apply to all participants)
//
defcon makeMyIdentitySet(?CN) :-
spec('Construct an identity set for self'),
{
principal($SelfKey) :- spec("identity set for $CN").
}.
defpost postRawIdSet(?CN) :- [makeMyIdentitySet(?CN)].
defcon makeMyIdentitySetWithPreferredStore(?CN, ?StoreAddr, ?Protocol, ?ServerID) :-
spec('Construct an identity set for self'),
{
principal($SelfKey) :- spec("identity set for $CN").
preferredSetStore($StoreAddr, $Protocol, $ServerID) :- spec("Preferred stores specified by writer").
}.
defpost postIdSet(?CN, ?StoreAddr, ?Protocol, ?ServerID) :-
[makeMyIdentitySetWithPreferredStore(?CN, ?StoreAddr, ?Protocol, ?ServerID)].
defcon addSetStoreToIDSet(?StoreAddr, ?Protocol, ?ServerID) :-
spec('Add a set store into identity set'),
{
preferredSetStore($StoreAddr, $Protocol, $ServerID).
}.
defpost updateIDSet(?StoreAddr, ?Protocol, ?ServerID) :-
[addSetStoreToIDSet(?StoreAddr, ?Protocol, ?ServerID)].
defcon makeMySubjectSet() :-
spec("Construct a subject set for self"),
{
link($Self).
label("subject($Self)").
}.
defpost postSubjectSet() :- [makeMySubjectSet()].
defcon addTokenToSubjectSet(?Token) :-
spec("Add a token to the user's subject set."),
{
link($Token).
label("subject($Self)").
}.
defpost updateSubjectSet(?Token) :- [addTokenToSubjectSet(?Token)].