# # This example shows the use of multiple contexts in one session. This is # based on alumni3_rt1, which is an example of reasoning about a role's # parameters with range constraints. There are 6 principals StateU, # Bob, Mark, Maryann, Joe, and Jan. StateU wants to establish a set of # founding alum # based on the year of graduation. On graduation each alum # has previously # been issued a credential parameterized with their # major and graduation year. StateU sets up a policy that says that a # principal is a founding alumni if they graduated in 1960, 1961, or 1963 # in either mathematics or psychology only. This # policy is expressed in # Credential 1. # # Credentials 2, 3, 4, 5, and 6 each assign a diploma credential to Bob (a 1961 # mathematics degree), Mark (a 1965 mathematics degree), Joe (a 1961 zoology degree), # Maryann (a 1962 psychology degree), and Jan (a 1960 psychology degree) # # The query.py asks if each of these principals are favored alums, and only # Bob and Jan are, in a multiple contexts scenario. # # context#A is made with credential 1, 2, 3, context#B is duplicate from # context#A and then credential 4, 5, 6 are inserted. context#C is built # with credential 1, 4, 5, 6. When query for favored # alums, from context#A, # only Bob is, from context#B, both Bob and Jan are, and from context#C only # Jan should show up. # # alumni3_ctxt_rt1 # Credential 1 # [keyid:stateU].role:foundingAlumni # <- [keyid:stateU].role:diploma([string:?D:['mathmatics','psychology']], # [integer:?Year:[1960,1961,1963]]) # Credential 2 # [keyid:stateU].role:diploma([string:'mathmatics'],[integer:1961]) <- [keyid:bob] # Credential 3 # [keyid:stateU].role:diploma([string:'mathmatics'],[integer:1965]) <- [keyid:mark] # Credential 4 # [keyid:stateU].role:diploma([string:'zoology'],[integer:1961]) <- [keyid:joe] # Credential 5 # [keyid:stateU].role:diploma([string:'psychology'],[integer:1962]) <- [keyid:maryann] # Credential 6 # [keyid:stateU].role:diploma([string:'psychology'],[integer:1960]) <- [keyid:jan]