Index: examples/access_rt2_typed/README
===================================================================
--- examples/access_rt2_typed/README	(revision 8fa2c49e70298e72ec953c542f23bd56112068ab)
+++ examples/access_rt2_typed/README	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
@@ -83,5 +83,5 @@
 # 
 # [keyid:alpha].role:access([string:'read'], [urn:?F])<- [principal:?B] 
-#                [keyid:alpha].oset:documents([keyid:?P) <- [urn:?F]
+#                [keyid:alpha].oset:documents([string:?P) <- [urn:?F]
 #                [keyid:alpha].role:team([string:?P]) <- [principal:?B]
 # 
Index: examples/access_rt2_typed/rr
===================================================================
--- examples/access_rt2_typed/rr	(revision 8fa2c49e70298e72ec953c542f23bd56112068ab)
+++ examples/access_rt2_typed/rr	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
@@ -20,5 +20,5 @@
 joe_prin="[keyid:$joe]"
 
-## dump all credentials -- does not work
+## dump all credentials 
 $eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
 
Index: examples/allout.save
===================================================================
--- examples/allout.save	(revision 8fa2c49e70298e72ec953c542f23bd56112068ab)
+++ examples/allout.save	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
@@ -171,4 +171,33 @@
  pStateU.foundingAlumni <- pStateU.diploma(_,Year:[1955..1958])
  pStateU.diploma('psychology',1956) <- pMaryann
+ 
+===good============ stateU.foundingAlumni <- Joe yap 
+YAP query succeed
+prover success!!
+credentials needed :
+ pStateU.foundingAlumni <- pStateU.diploma(_,Year:[1955..1958])
+ pStateU.diploma('zoology',1955) <- pJoe
+
+ ==> RUN on balltime_rt2_typed
+YAP dump succeed
+ 
+===good============ league.stadium(access,20120128T130000]<-?-john  yap 
+YAP query succeed
+prover success!!
+credentials needed :
+ pLeague.stadium('access',F:pLeague.gametime(T)) <- pLeague.players(T)
+ pLeague.gametime('north') <- time(2012,02,28,13,00,00)
+ pLeague.players('north') <- pJohn
+ 
+===bad============ league.stadium(access,20120128T110000]<-?-mark  yap 
+YAP query failed
+prover failed!!
+ 
+===good============ league.stadium(access,20120128T080000]<-?-mark  yap 
+YAP query succeed
+prover success!!
+credentials needed :
+ pLeague.stadium('access',F:[20120228T080000..20120228T090000]) <- pLeague.players(T)
+ pLeague.players('south') <- pMark
 
  ==> RUN on evaluator_rt1_typed
@@ -183,5 +212,5 @@
  pISI.managerOf(pMaryann) <- pJohn
  
-===good============ USC.evaluatorOf(Maryann) <- John yap 
+===good============ ISI.managerOf(Maryann) <- John yap 
 YAP query succeed
 prover success!!
Index: examples/alumni2_rt1_typed/creds_dump
===================================================================
--- examples/alumni2_rt1_typed/creds_dump	(revision 8fa2c49e70298e72ec953c542f23bd56112068ab)
+++ 	(revision )
@@ -1,4 +1,0 @@
- pStateU.diploma('mathmatics',1961) <- pBob
- pStateU.diploma('zoology',1955) <- pJoe
- pStateU.diploma('psychology',1962) <- pMaryann
- pStateU.foundingAlumni <- pStateU.diploma(_,Year:[1963,1961,1960])
Index: examples/alumni_rt1_typed/README
===================================================================
--- examples/alumni_rt1_typed/README	(revision 8fa2c49e70298e72ec953c542f23bd56112068ab)
+++ examples/alumni_rt1_typed/README	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
@@ -17,6 +17,8 @@
 
 rm -rf *.der *.pem
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (no)
 # [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (yes)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (yes)
 
 creddy --generate --cn StateU
Index: examples/alumni_rt1_typed/rr
===================================================================
--- examples/alumni_rt1_typed/rr	(revision 8fa2c49e70298e72ec953c542f23bd56112068ab)
+++ examples/alumni_rt1_typed/rr	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
@@ -36,6 +36,5 @@
 
 
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (yes)
-# asking, isMember(pMaryann,role(pStateU,foundingAlumni),C).
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (yes)
 echo " "
 echo "===good============ stateU.foundingAlumni <- Joe yap "
Index: examples/balltime_rt2_typed/README
===================================================================
--- examples/balltime_rt2_typed/README	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
+++ examples/balltime_rt2_typed/README	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
@@ -0,0 +1,121 @@
+#!/bin/sh
+
+#####################################################################
+# This example demonstrates using an oset (object set) to control access
+# to files based on the attributes of the principals.  The script creates
+# three principals League, John and Mark and sets out the access policy.
+# 
+# files are named by URNs and are not principals.
+# 
+# A principal's access rights are controlled by the League principal.  If a 
+# principal has the role role::stadium(string:'access', time:current) that 
+# principal can go into stadium if principal's team has a scheduled gametime.
+# A principal is in team's roster if it is in
+# the oset of players(team) defined by League, written
+# [keyid:League].oset:players(string:'north'))
+# 
+# The example below lays out the policy that players of a given team can
+# go to the stadium when it is their team's gametime -- credential 1.
+# or any player of a team that is controlled by the League principal can
+# go to the stadium during stadium's free for all time -- credential 2.
+#
+# Credentials 3 & 4 establish the afernoon gametimes for team(north) 
+# and for team(south)
+# Credentials 5 & 6 establish John as player of team(north) and Mark as
+# a player for team(south)
+#
+# The attached ./rr file runs 3 queries.  First it confirms that John can 
+# go to stadium at his team's gametime, then it confirms that Mark cannot
+# go because it is not his gametime, but Mark can go to the stadium during
+# stadium's free-for-all early morning time
+
+rm -rf *.der *.pem
+
+creddy --generate --cn League
+creddy --generate --cn John
+creddy --generate --cn Mark
+
+league_keyid=`creddy --keyid --cert League_ID.pem`
+john_keyid=`creddy --keyid --cert John_ID.pem`
+mark_keyid=`creddy --keyid --cert Mark_ID.pem`
+
+stadium_qFqT="stadium([string:'access'],[time:?F[keyid:$league_keyid].oset:gametime([string:?T])])"
+stadium_qR="stadium([string:'access'],[time:?F:[20120228T080000..20120228T090000]])"
+
+players_qT="players([string:?T])" 
+
+#[keyid:league].role:stadium([string:'access'],
+#          [time:?F:[keyid:league].oset.gametime([string:?T])])
+#                <-[keyid:league].role:players([string:?T])
+# Credential 1
+creddy --attribute \
+       --issuer League_ID.pem --key League_private.pem --role "$stadium_qFqT" \
+       --subject-cert League_ID.pem --subject-role "$players_qT" \
+       --out League_access_qFqT__League_players_qT_attr.der
+
+#[keyid:league].role:stadium([string:'access'],
+#              [time:?F:[20120228T080000..20120228T090000]])
+#               <- [keyid:league].role:players(string:?T) 
+# Credential 2 
+creddy --attribute \
+       --issuer League_ID.pem --key League_private.pem --role "$stadium_qR" \
+       --subject-cert League_ID.pem --subject-role "$players_qT" \
+       --out League_access_qR__League_players_qT_attr.der
+
+
+# [keyid:league].oset:gametime([time:20120228T130000])
+#                    <- [keyid:league].oset:players([string:'north') 
+# Credential 3
+creddy --attribute \
+        --issuer League_ID.pem --key League_private.pem \
+        --oset "gametime([string:'north'])" \
+        --subject-obj "[time:20120228T130000]" \
+        --out League_gametime_north__timeT_attr.der
+
+# [keyid:league].oset:gametime([time:20120228T140000])
+#                    <- [keyid:league].oset:players([string:'south') 
+# Credential 4 
+creddy --attribute \
+        --issuer League_ID.pem --key League_private.pem \
+        --oset "gametime([string:'south'])" \
+        --subject-obj "[time:20120228T140000]" \
+        --out League_gametime_south__time2T_attr.der
+
+# [keyid:league].role:players([string:'north'])<-[keyid:John]
+creddy --attribute \
+        --issuer League_ID.pem --key League_private.pem \
+        --role "players([string:'north'])" \
+        --subject-cert John_ID.pem \
+        --out League_players_north__John_attr.der
+
+# [keyid:league].role:players([string:'south'])<-[keyid:Mark]
+creddy --attribute \
+        --issuer League_ID.pem --key League_private.pem \
+        --role "players([string:'south'])" \
+        --subject-cert Mark_ID.pem \
+        --out League_players_south__Mark_attr.der
+
+#####################################################################
+#league allows member of a team to access stadium at their team's designed time
+#
+#[keyid:league].role:stadium([string:'access'],
+#          [time:?F:[keyid:league].oset.gametime([string:?T])])
+#                <-[keyid:league].role:players([string:?T])
+#
+#[keyid:league].role:stadium([string:'access'],[time:?Tm]) <- [principal:?P]
+#[keyid:league].oset:gametime(string:?Team) <- [time:?Tm]
+#[keyid:league].role:player(string:?Team) <- [principal:?P]
+#
+#
+#league.stadium(access,?Time:league.gametime(?Team)) <- league.players(?Teams)
+#              league.player(north) <- john
+#              league.player(south) <- mark 
+#              league.gametime(north) <- [time:'20120228T130000']
+#              league.gametime(south) <- [time:'20120228T140000']
+#
+#league.statdium(access,?FreeTime:[20120228T080000..20120228T090000]) 
+#                  <- league.players(_).
+#
+#[keyid:league].role:stadium([string:'access'],
+#              [time:?F:['20120228T080000'..'20120228T090000']])
+#               <- [keyid:league].role:players(string:?T) 
Index: examples/balltime_rt2_typed/rr
===================================================================
--- examples/balltime_rt2_typed/rr	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
+++ examples/balltime_rt2_typed/rr	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
@@ -0,0 +1,39 @@
+
+rm -rf creds_dump
+
+pwd=`pwd`
+
+#eloc=/home/mei/Deter/abac/libabac
+eloc=$pwd/../../libabac
+#keyloc=/home/mei/Deter/abac/examples/balltime_rt2_typed
+keyloc=$pwd
+
+league=`creddy --keyid --cert $keyloc/League_ID.pem`
+john=`creddy --keyid --cert $keyloc/John_ID.pem`
+mark=`creddy --keyid --cert $keyloc/Mark_ID.pem`
+
+stadium_accessT="[keyid:$league].role:stadium([string:'access'],[time:20120228T130000])"
+stadium_accessT2="[keyid:$league].role:stadium([string:'access'],[time:20120228T110000])"
+stadium_accessT3="[keyid:$league].role:stadium([string:'access'],[time:20120228T080000])"
+
+john_prin="[keyid:$john]"
+mark_prin="[keyid:$mark]"
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:$league].role:stadium([string:'access'],[time:20120228T130000]) <-?- [keyid:john] (yes)
+echo " "
+echo "===good============ league.stadium(access,20120128T130000]<-?-john  yap "
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT" --principal "$john_prin"
+
+#[keyid:$league].role:stadium([string:'access'],[time:20120228T110000]) <-?- [keyid:mark] (no)
+echo " "
+echo "===bad============ league.stadium(access,20120128T110000]<-?-mark  yap "
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT2" --principal "$mark_prin"
+
+#[keyid:$league].role:stadium([string:'access'],[time:20120228T080000]) <-?- [keyid:mark] (yes)
+echo " "
+echo "===good============ league.stadium(access,20120128T080000]<-?-mark  yap "
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT3" --principal "$mark_prin"
+
Index: examples/fruits_rt2_typed/creds_dump
===================================================================
--- examples/fruits_rt2_typed/creds_dump	(revision 8fa2c49e70298e72ec953c542f23bd56112068ab)
+++ 	(revision )
@@ -1,6 +1,0 @@
- pRalphs.fruitprice(1.50) <- 'apple'
- pRalphs.fruitprice(2.50) <- 'black rasberry'
- pRalphs.fruitprice(1.50) <- 'kiwi'
- pRalphs.fruitprice(0.50) <- 'navel orange'
- pBob.what2eat <- pRalphs.fruitprice(P:[1.00..5.00])
- pMary.what2eat <- pRalphs.fruitprice(P:[..2.00])
