Index: examples/README
===================================================================
--- examples/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,4 +1,2 @@
-
-Example directories
 
 This directory contains various ABAC scenario that exercises
@@ -8,7 +6,7 @@
 
 Each subdirectory has a README script which includes a description
-of the scenario and the calls that are needed to generate the 
-credentials. There is a rr script which sets up and run couple
-of typical query using abac_yap_prover.
+of the scenario, and the calls that to generate the needed credentials. 
+There is a run_query script which sets up and runs couple of typical 
+query using abac_yap_prover.
 
 runall, is the top level script that will cleanup and setup the
@@ -30,13 +28,14 @@
     extracts all credentials from the prolog db
 
-keystore is the location where the prover will search for credentials.
-All accessible iden credentials and attribute credentials will be 
+keystore is the location where the prover will search to load credentials.
+All accessible identity credentials and attribute credentials will be 
 picked up one file at a time.
 
-role, oset, principal, and object are specified with principal's SHA 
-value extracted from keystore location using creddy. Example can be found
-in the rr script.
+role, oset, principal, and object are specified with principal's SHA1 
+value extracted from the credentials that are loaded from keystore location
+using creddy. Example can be found in the run_queryscript.
 
-An actual example from balltime_rt2_typed is here,
+An actual example from balltime_rt2_typed,
+
 abac_prover_yap --keystore /home/mei/Deter/abac/examples/balltime_rt2_typed 
   --role [keyid:212146063d65264e8f27c31f0da592e386fc59aa].role:stadium
@@ -50,11 +49,11 @@
 
 DUMP_DB, extract the complete yap db to stdout
-ABAC_CN, use CN instead of SHA value for identifying the principal keyid. This
+ABAC_CN, use CN instead of SHA1 value for identifying the principals. This
 is useful for debugging purpose but will not resolve conflict when CN is not
-uniquely associated with each principal SHA value.
+uniquely associated with each principal's SHA1 value.
 
 env ABAC_CN=1 runall run
 or
-env DUMP_DB=1 ABAC_CN=1 rr
+env DUMP_DB=1 ABAC_CN=1 run_query
 
 
Index: examples/access_rt2_typed/README
===================================================================
--- examples/access_rt2_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/access_rt2_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -23,9 +23,9 @@
 # required for fileA.  Credentials 3 & 4 add Bob to proj1 and Joe to proj2.
 #
-# The attached ./rr file runs 3 queries.  First it confirms that Bob can Read
+# The attached ./run_query file runs 3 queries.  First it confirms that Bob can Read
 # fileA, then it confirms that Joe cannot.  Finally it confirms that Joe is in
 # proj2.
 
-rm -rf *.der *.pem
+# access_rt2_typed
 
 # alpha.access(Read,fileA)<-?-bob  good
@@ -39,5 +39,4 @@
 bob_keyid=`creddy --keyid --cert Bob_ID.pem`
 joe_keyid=`creddy --keyid --cert Joe_ID.pem`
-
 
 access_qFqP="access([string:'Read'],[urn:?F[keyid:$alpha_keyid].oset:documents([string:?P])])"
@@ -54,4 +53,5 @@
 
 
+# Credential 2
 #[keyid:alpha].oset:documents([string:'proj1'])<-[urn:'file//fileA'] 
 creddy --attribute \
@@ -61,4 +61,5 @@
         --out Alpha_documents_proj1__fileA_attr.der
 
+# Credential 3
 # [keyid:alpha].role:team([string:'proj1'])<-[keyid:Bob]
 creddy --attribute \
@@ -68,4 +69,5 @@
         --out Alpha_team_proj1__Bob_attr.der
 
+# Credential 4
 # [keyid:alpha].role:team([string:'proj2'])<-[keyid:Joe]
 creddy --attribute \
Index: examples/access_rt2_typed/query.py
===================================================================
--- examples/access_rt2_typed/query.py	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/access_rt2_typed/query.py	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+"""
+  to test with python
+
+env PYTHON_PATH=/usr/local/lib/python2.7/site-packages ABAC_CN=1 keystore=`pwd` alpha=`creddy --keyid --cert Alpha_ID.pem` bob=`creddy --keyid --cert Bob_ID.pem` ./query.py
+
+"""
+
+import os
+import ABAC
+
+ctxt = ABAC.Context()
+
+keystore=os.environ["keystore"]
+alpha=os.environ["alpha"]
+bob=os.environ["bob"]
+
+ctxt.load_directory(keystore)
+
+role ="[keyid:%s].role:access([string:'Read'],[urn:'file//fileA'])" % alpha
+p = "[keyid:%s]" % bob
+
+out = ctxt.query(role, p)
+print out
+
+for c in out[1]:
+    print "%s <- %s" % (c.head().string(), c.tail().string())
+
+
Index: examples/access_rt2_typed/rr
===================================================================
--- examples/access_rt2_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,36 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-alpha=`creddy --keyid --cert $keyloc/Alpha_ID.pem`
-bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
-joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
-
-bob_prin="[keyid:$bob]"
-
-access_fileA="[keyid:$alpha].role:access([string:'Read'],[urn:'file//fileA'])"
-team_proj2="[keyid:$alpha].role:team([string:'proj2'])"
-bob_prin="[keyid:$bob]"
-joe_prin="[keyid:$joe]"
-
-## dump all credentials 
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-#[keyid:Alpha].role:access([string:'Read'],[urn:'file//fileA']) <-?- [keyid:bob] (yes)
-echo " "
-echo "===good============ Alpha.access(Read,fileA)<-?-Bob  yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$access_fileA" --principal "$bob_prin"
-
-echo " "
-echo "===bad============ Alpha.access(Read,fileA)<-?-Joe  yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$access_fileA" --principal "$joe_prin"
-
-echo " "
-echo "===good============ Alpha.team(proj2)<-?-Joe  yap "
-#[keyid:alpha].oset:team([string:'proj2'])<-[keyid:Joe]
-$eloc/abac_prover_yap  --keystore $keyloc --role "$team_proj2" --principal "$joe_prin"
-
Index: examples/access_rt2_typed/run_query
===================================================================
--- examples/access_rt2_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/access_rt2_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,37 @@
+
+
+# access_rt2_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+alpha=`creddy --keyid --cert $keyloc/Alpha_ID.pem`
+bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
+joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
+
+bob_prin="[keyid:$bob]"
+
+access_fileA="[keyid:$alpha].role:access([string:'Read'],[urn:'file//fileA'])"
+team_proj2="[keyid:$alpha].role:team([string:'proj2'])"
+bob_prin="[keyid:$bob]"
+joe_prin="[keyid:$joe]"
+
+## dump all credentials 
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:Alpha].role:access([string:'Read'],[urn:'file//fileA']) <-?- [keyid:bob] (yes)
+echo " "
+echo "===good============ Alpha.access(Read,fileA)<-?-Bob"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$access_fileA" --principal "$bob_prin"
+
+echo " "
+echo "===bad============ Alpha.access(Read,fileA)<-?-Joe"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$access_fileA" --principal "$joe_prin"
+
+echo " "
+echo "===good============ Alpha.team(proj2)<-?-Joe"
+#[keyid:alpha].oset:team([string:'proj2'])<-[keyid:Joe]
+$eloc/abac_prover_yap  --keystore $keyloc --role "$team_proj2" --principal "$joe_prin"
+
Index: examples/acme_friend_rt1_typed/README
===================================================================
--- examples/acme_friend_rt1_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/acme_friend_rt1_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,3 +1,4 @@
 #!/bin/sh
+#
 # This example shows how a parameterized role can be used to infer a role and
 # that the same role can also be directly assigned.  The example has 4
@@ -14,5 +15,5 @@
 # Acme thinks that the Jackrabbit is the Roadrunner's friend.
 # 
-# The attached ./rr script tests whether the coyote is a friend of the
+# The attached ./run_query script tests whether the coyote is a friend of the
 # Roadrunner (which fails), whether the Jackrabbit is a friend of teh
 # Roadrunner (which succeeds), whether the Jackrabbit is a preferred customer
@@ -21,5 +22,5 @@
 # does).
 
-rm -rf *.der *.pem
+# acme_friend_rt1_typed
 
 #[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Coyote] (no)
Index: examples/acme_friend_rt1_typed/rr
===================================================================
--- examples/acme_friend_rt1_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,48 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-roadrunner=`creddy --keyid --cert $keyloc/Roadrunner_ID.pem`
-acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
-coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
-jackrabbit=`creddy --keyid --cert $keyloc/Jackrabbit_ID.pem`
-
-friendof_roadrunner="[keyid:$acme].role:friendOf([keyid:$roadrunner])"
-coyote_prin="[keyid:$coyote]"
-badcoyote_prin="[keyid:bad]"
-preferred_customer="[keyid:$acme].role:preferred_customer"
-jackrabbit_prin="[keyid:$jackrabbit]"
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-#[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Coyote] yap
-echo "  "
-echo "===bad============ Acme.friendOf(Roadrunner) <- Coyote yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$friendof_roadrunner" --principal "$coyote_prin"
-
-#[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Jackrabbit] yap
-echo "  "
-echo "===good============ Acme.friendOf(Roadrunner) <- Jackrabbit yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$friendof_roadrunner" --principal "$jackrabbit_prin"
-
-#[keyid:Acme].role:preferred_customer <-?- [keyid:Jackrabbit] yap
-echo "  "
-echo "===good============ Acme.preferred_customer <- Jackrabbit yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$preferred_customer" --principal "$jackrabbit_prin"
-
-#[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote] yap
-echo "  "
-echo "===good============ Acme.preferred_customer <- Coyote yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$preferred_customer" --principal "$coyote_prin"
-
-#[keyid:Acme].role:preferred_customer <-?- [keyid:badCoyote] yap
-echo "  "
-echo "===bad============ Acme.preferred_customer <- badCoyote yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$preferred_customer" --principal "$badcoyote_prin"
-
-
Index: examples/acme_friend_rt1_typed/run_query
===================================================================
--- examples/acme_friend_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/acme_friend_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,48 @@
+
+# acme_friend_rt1_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+roadrunner=`creddy --keyid --cert $keyloc/Roadrunner_ID.pem`
+acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
+coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
+jackrabbit=`creddy --keyid --cert $keyloc/Jackrabbit_ID.pem`
+
+friendof_roadrunner="[keyid:$acme].role:friendOf([keyid:$roadrunner])"
+coyote_prin="[keyid:$coyote]"
+badcoyote_prin="[keyid:bad]"
+preferred_customer="[keyid:$acme].role:preferred_customer"
+jackrabbit_prin="[keyid:$jackrabbit]"
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Coyote]
+echo "  "
+echo "===bad============ Acme.friendOf(Roadrunner) <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$friendof_roadrunner" --principal "$coyote_prin"
+
+#[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Jackrabbit]
+echo "  "
+echo "===good============ Acme.friendOf(Roadrunner) <- Jackrabbit"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$friendof_roadrunner" --principal "$jackrabbit_prin"
+
+#[keyid:Acme].role:preferred_customer <-?- [keyid:Jackrabbit]
+echo "  "
+echo "===good============ Acme.preferred_customer <- Jackrabbit"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$preferred_customer" --principal "$jackrabbit_prin"
+
+#[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote]
+echo "  "
+echo "===good============ Acme.preferred_customer <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$preferred_customer" --principal "$coyote_prin"
+
+#[keyid:Acme].role:preferred_customer <-?- [keyid:badCoyote]
+echo "  "
+echo "===bad============ Acme.preferred_customer <- badCoyote"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$preferred_customer" --principal "$badcoyote_prin"
+
+
Index: examples/acme_rockets_intersection_rt0_typed/README
===================================================================
--- examples/acme_rockets_intersection_rt0_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/acme_rockets_intersection_rt0_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,6 +1,3 @@
 #!/bin/sh
-
-rm -rf *.der *.pem
-
 #
 # This example demonstrates intersections.  An intersection is a logical and of
@@ -29,5 +26,5 @@
 #    Acme.buy_rockets <-?- Batman
 # 
-# The attached ./rr file carries out these queries.  As well as 2 queries for
+# The attached ./run_query file carries out these queries.  As well as 2 queries for
 # non-existant certificates (which fail).
 #
@@ -37,4 +34,6 @@
 #WarnerBros.character <- Coyote
 #
+
+# acme_rockets_intersection_rt0_typed
 
 creddy --generate --cn Acme
Index: examples/acme_rockets_intersection_rt0_typed/rr
===================================================================
--- examples/acme_rockets_intersection_rt0_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,51 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
-batman=`creddy --keyid --cert $keyloc/Batman_ID.pem`
-coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
-
-buy_rockets="[keyid:$acme].role:buy_rockets"
-coyote_prin="[keyid:$coyote]"
-batman_prin="[keyid:$batman]"
-bad_buy_rockets="[keyid:$acme].role:bad_buy_rockets"
-bad_buy_rockets2="[keyid:99$acme].role:buy_rockets"
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-#[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote] yap
-#isMember(pCoyote, role(pAcme,buy_rockets), C).
-echo "  "
-echo "===good============ Acme.buy_rockets <- Coyote yap "
-$eloc/abac_prover_yap  --keystore $keyloc \
-              --role "$buy_rockets" --principal "$coyote_prin"
-
-#[keyid:Acme].role:bad_buy_rockets <-?- [keyid:Coyote] yap
-#isMember(pCoyote, role(pAcme,bad_buy_rockets), C).
-echo "  "
-echo "===bad============ Acme.bad_buy_rockets <- Coyote yap"
-$eloc/abac_prover_yap  --keystore $keyloc \
-              --role "$bad_buy_rockets" --principal "$coyote_prin"
-
-#[keyid:Acme99].role:buy_rockets <-?- [keyid:Coyote] yap
-#isMember(pCoyote99, role(99pAcme,buy_rockets), C).
-echo "  "
-echo "===bad============ 99Acme.buy_rockets <- Coyote yap"
-$eloc/abac_prover_yap  --keystore $keyloc \
-              --role "$bad_buy_rockets2" --principal "$coyote_prin"
-
-#Acme.buy_rockets <-?- Batman yap
-#[keyid:Acme].role:buy_rockets <-?- [keyid:Batman] yap
-#isMember(pBatman, role(pAcme,buy_rockets), C).
-echo "  "
-echo "===bad=============== Acme.buy_rockets <- Batman yap"
-$eloc/abac_prover_yap  --keystore $keyloc \
-              --role "$buy_rockets" --principal "$batman_prin"
-
-
Index: examples/acme_rockets_intersection_rt0_typed/run_query
===================================================================
--- examples/acme_rockets_intersection_rt0_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/acme_rockets_intersection_rt0_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,51 @@
+
+# acme_rockets_intersection_rt0_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
+batman=`creddy --keyid --cert $keyloc/Batman_ID.pem`
+coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
+
+buy_rockets="[keyid:$acme].role:buy_rockets"
+coyote_prin="[keyid:$coyote]"
+batman_prin="[keyid:$batman]"
+bad_buy_rockets="[keyid:$acme].role:bad_buy_rockets"
+bad_buy_rockets2="[keyid:99$acme].role:buy_rockets"
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote]
+#isMember(pCoyote, role(pAcme,buy_rockets), C).
+echo "  "
+echo "===good============ Acme.buy_rockets <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc \
+              --role "$buy_rockets" --principal "$coyote_prin"
+
+#[keyid:Acme].role:bad_buy_rockets <-?- [keyid:Coyote]
+#isMember(pCoyote, role(pAcme,bad_buy_rockets), C).
+echo "  "
+echo "===bad============ Acme.bad_buy_rockets <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc \
+              --role "$bad_buy_rockets" --principal "$coyote_prin"
+
+#[keyid:Acme99].role:buy_rockets <-?- [keyid:Coyote]
+#isMember(pCoyote99, role(99pAcme,buy_rockets), C).
+echo "  "
+echo "===bad============ 99Acme.buy_rockets <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc \
+              --role "$bad_buy_rockets2" --principal "$coyote_prin"
+
+#Acme.buy_rockets <-?- Batman
+#[keyid:Acme].role:buy_rockets <-?- [keyid:Batman]
+#isMember(pBatman, role(pAcme,buy_rockets), C).
+echo "  "
+echo "===bad=============== Acme.buy_rockets <- Batman"
+$eloc/abac_prover_yap  --keystore $keyloc \
+              --role "$buy_rockets" --principal "$batman_prin"
+
+
Index: examples/acme_rockets_rt0_typed/README
===================================================================
--- examples/acme_rockets_rt0_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/acme_rockets_rt0_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,4 +1,4 @@
 #!/bin/sh
-
+#
 # The example makes use of 2 principals, Acme and Coyote.
 #
@@ -9,10 +9,10 @@
 # Credential 2 defines the Coyote as an Acme preferred customer.
 
-# The ./rr script issues queries to show that the Coyote is both a preferred
+# The ./run_query script issues queries to show that the Coyote is both a preferred
 # customer and can buy rockets.  Two invalid queries are also made, checking if
 # Acme is the Coyote's friend, which it isn't and whether a query about
 # something other than a principal works (it doesn't).
 
-rm -rf *.der *.pem
+# acme_rockets_rt0_typed
 
 creddy --generate --cn Acme
Index: examples/acme_rockets_rt0_typed/rr
===================================================================
--- examples/acme_rockets_rt0_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,48 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
-coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
-
-preferred_customer="[keyid:$acme].role:preferred_customer"
-buy_rockets="[keyid:$acme].role:buy_rockets"
-coyote_prin="[keyid:$coyote]"
-friend="[keyid:$acme].role:friend"
-acme_prin="[keyid:$acme]"
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-#[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote] yap
-#isMember(pCoyote, role(pAcme,preferred_customer), C).
-echo "  "
-echo "===good============ Acme.preferred_customer <- Coyote yap "
-$eloc/abac_prover_yap  --keystore $keyloc \
-      --role "$preferred_customer" --principal "$coyote_prin"
-
-#[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote] yap
-#isMember(pCoyote, role(pAcme,buy_rockets), C).
-echo "  "
-echo "===good=============== Acme.buy_rockets <- Coyote yap"
-$eloc/abac_prover_yap  --keystore $keyloc \
-        --role "$buy_rockets" --principal "$coyote_prin"
-
-## this is not suppose to work
-#[keyid:Acme].role:buy_rockets <-?- [keyid:Acme].role:preferred_customer yap
-echo "  "
-echo "===bad=============== Acme.buy_rockets <- Acme.preferred_customer yap"
-$eloc/abac_prover_yap  --keystore $keyloc \
-        --role "$buy_rockets" --principal "$preferred_customer"
-
-#[keyid:Coyote].role:friend <-?- [keyid:Acme] yap
-#isMember(pAcme, role(pCoyote,friend), C).
-echo "  "
-echo "===bad=============== Coyote.friend <- Acme yap"
-$eloc/abac_prover_yap  --keystore $keyloc \
-        --role "$friend" --principal "$acme_prin"
-
Index: examples/acme_rockets_rt0_typed/run_query
===================================================================
--- examples/acme_rockets_rt0_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/acme_rockets_rt0_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,48 @@
+
+# acme_rockets_rt0_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
+coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
+
+preferred_customer="[keyid:$acme].role:preferred_customer"
+buy_rockets="[keyid:$acme].role:buy_rockets"
+coyote_prin="[keyid:$coyote]"
+friend="[keyid:$acme].role:friend"
+acme_prin="[keyid:$acme]"
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote]
+#isMember(pCoyote, role(pAcme,preferred_customer), C).
+echo "  "
+echo "===good============ Acme.preferred_customer <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc \
+      --role "$preferred_customer" --principal "$coyote_prin"
+
+#[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote]
+#isMember(pCoyote, role(pAcme,buy_rockets), C).
+echo "  "
+echo "===good=============== Acme.buy_rockets <- Coyote"
+$eloc/abac_prover_yap  --keystore $keyloc \
+        --role "$buy_rockets" --principal "$coyote_prin"
+
+## this is not suppose to work
+#[keyid:Acme].role:buy_rockets <-?- [keyid:Acme].role:preferred_customer
+echo "  "
+echo "===bad=============== Acme.buy_rockets <- Acme.preferred_customer"
+$eloc/abac_prover_yap  --keystore $keyloc \
+        --role "$buy_rockets" --principal "$preferred_customer"
+
+#[keyid:Coyote].role:friend <-?- [keyid:Acme]
+#isMember(pAcme, role(pCoyote,friend), C).
+echo "  "
+echo "===bad=============== Coyote.friend <- Acme"
+$eloc/abac_prover_yap  --keystore $keyloc \
+        --role "$friend" --principal "$acme_prin"
+
Index: examples/alice_rt1_typed/README
===================================================================
--- examples/alice_rt1_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/alice_rt1_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -3,5 +3,5 @@
 ## trying out different data param types
 
-rm -rf *.der *.pem
+# alice_rt1_typed
 
 creddy --generate --cn Alice
Index: examples/alice_rt1_typed/rr
===================================================================
--- examples/alice_rt1_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,31 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-alice=`creddy --keyid --cert Alice_ID.pem`
-party=`creddy --keyid --cert Party_ID.pem`
-tea=`creddy --keyid --cert Tea_ID.pem`
-hatter=`creddy --keyid --cert Hatter_ID.pem`
-marchhare=`creddy --keyid --cert MarchHare_ID.pem`
-dormouse=`creddy --keyid --cert Dormouse_ID.pem`
-
-party_guests="[keyid:$party].role:guests"
-dormouse_prin="[keyid:$dormouse]"
-hatter_prin="[keyid:$hatter]"
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-#[keyid:Party].role:guests <-?- [keyid:dormouse] yap
-echo "  "
-echo "===good============ Party.guests <- dourmouse yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$party_guests" --principal "$dormouse_prin"
-
-#[keyid:Party].role:guests <-?- [keyid:hatter] yap
-echo "  "
-echo "===bad============ Party.guests <- hatter yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$party_guests" --principal "$hatter_prin"
Index: examples/alice_rt1_typed/run_query
===================================================================
--- examples/alice_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/alice_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,32 @@
+
+# alice_rt1_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+alice=`creddy --keyid --cert Alice_ID.pem`
+party=`creddy --keyid --cert Party_ID.pem`
+tea=`creddy --keyid --cert Tea_ID.pem`
+hatter=`creddy --keyid --cert Hatter_ID.pem`
+marchhare=`creddy --keyid --cert MarchHare_ID.pem`
+dormouse=`creddy --keyid --cert Dormouse_ID.pem`
+
+party_guests="[keyid:$party].role:guests"
+dormouse_prin="[keyid:$dormouse]"
+hatter_prin="[keyid:$hatter]"
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:Party].role:guests <-?- [keyid:dormouse]
+echo "  "
+echo "===good============ Party.guests <- dourmouse"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$party_guests" --principal "$dormouse_prin"
+
+#[keyid:Party].role:guests <-?- [keyid:hatter]
+echo "  "
+echo "===bad============ Party.guests <- hatter"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$party_guests" --principal "$hatter_prin"
+
Index: examples/allout.save
===================================================================
--- examples/allout.save	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/allout.save	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -3,5 +3,5 @@
 YAP dump succeed
  
-===good============ Alpha.access(Read,fileA)<-?-Bob  yap 
+===good============ Alpha.access(Read,fileA)<-?-Bob
 YAP query succeed
 prover success!!
@@ -11,9 +11,9 @@
  pAlpha.team('proj1')  <- pBob 
  
-===bad============ Alpha.access(Read,fileA)<-?-Joe  yap 
-YAP query failed
-prover failed!!
- 
-===good============ Alpha.team(proj2)<-?-Joe  yap 
+===bad============ Alpha.access(Read,fileA)<-?-Joe
+YAP query failed
+prover failed!!
+ 
+===good============ Alpha.team(proj2)<-?-Joe
 YAP query succeed
 prover success!!
@@ -24,9 +24,9 @@
 YAP dump succeed
   
-===bad============ Acme.friendOf(Roadrunner) <- Coyote yap 
-YAP query failed
-prover failed!!
-  
-===good============ Acme.friendOf(Roadrunner) <- Jackrabbit yap 
+===bad============ Acme.friendOf(Roadrunner) <- Coyote
+YAP query failed
+prover failed!!
+  
+===good============ Acme.friendOf(Roadrunner) <- Jackrabbit
 YAP query succeed
 prover success!!
@@ -34,5 +34,5 @@
  pAcme.friendOf(pRoadrunner)  <- pJackrabbit 
   
-===good============ Acme.preferred_customer <- Jackrabbit yap 
+===good============ Acme.preferred_customer <- Jackrabbit
 YAP query succeed
 prover success!!
@@ -41,11 +41,11 @@
  pAcme.friendOf(pRoadrunner)  <- pJackrabbit 
   
-===good============ Acme.preferred_customer <- Coyote yap 
-YAP query succeed
-prover success!!
-credentials needed :
- pAcme.preferred_customer  <- pCoyote 
-  
-===bad============ Acme.preferred_customer <- badCoyote yap 
+===good============ Acme.preferred_customer <- Coyote
+YAP query succeed
+prover success!!
+credentials needed :
+ pAcme.preferred_customer  <- pCoyote 
+  
+===bad============ Acme.preferred_customer <- badCoyote
 yyerror: encountered an invalid SHA id
 prover failed!!
@@ -54,5 +54,5 @@
 YAP dump succeed
   
-===good============ Acme.buy_rockets <- Coyote yap 
+===good============ Acme.buy_rockets <- Coyote
 YAP query succeed
 prover success!!
@@ -62,13 +62,13 @@
  pWarnerBros.character  <- pCoyote 
   
-===bad============ Acme.bad_buy_rockets <- Coyote yap
-YAP query failed
-prover failed!!
-  
-===bad============ 99Acme.buy_rockets <- Coyote yap
+===bad============ Acme.bad_buy_rockets <- Coyote
+YAP query failed
+prover failed!!
+  
+===bad============ 99Acme.buy_rockets <- Coyote
 yyerror: encountered an invalid SHA id
 prover failed!!
   
-===bad=============== Acme.buy_rockets <- Batman yap
+===bad=============== Acme.buy_rockets <- Batman
 YAP query failed
 prover failed!!
@@ -77,11 +77,11 @@
 YAP dump succeed
   
-===good============ Acme.preferred_customer <- Coyote yap 
-YAP query succeed
-prover success!!
-credentials needed :
- pAcme.preferred_customer  <- pCoyote 
-  
-===good=============== Acme.buy_rockets <- Coyote yap
+===good============ Acme.preferred_customer <- Coyote
+YAP query succeed
+prover success!!
+credentials needed :
+ pAcme.preferred_customer  <- pCoyote 
+  
+===good=============== Acme.buy_rockets <- Coyote
 YAP query succeed
 prover success!!
@@ -90,8 +90,8 @@
  pAcme.preferred_customer  <- pCoyote 
   
-===bad=============== Acme.buy_rockets <- Acme.preferred_customer yap
+===bad=============== Acme.buy_rockets <- Acme.preferred_customer
 fail, a.r <- b.r query is not implemented yet !!!
   
-===bad=============== Coyote.friend <- Acme yap
+===bad=============== Coyote.friend <- Acme
 YAP query failed
 prover failed!!
@@ -100,5 +100,5 @@
 YAP dump succeed
   
-===good============ Party.guests <- dourmouse yap 
+===good============ Party.guests <- dourmouse
 YAP query succeed
 prover success!!
@@ -107,5 +107,5 @@
  pParty.friendOf(pMarchHare)  <- pDormouse 
   
-===bad============ Party.guests <- hatter yap 
+===bad============ Party.guests <- hatter
 YAP query failed
 prover failed!!
@@ -114,5 +114,5 @@
 YAP dump succeed
  
-===good============ stateU.foundingAlumni <- Bob yap 
+===good============ stateU.foundingAlumni <- Bob
 YAP query succeed
 prover success!!
@@ -121,9 +121,9 @@
  pStateU.diploma('mathmatics',1961)  <- pBob 
  
-===bad============ stateU.foundingAlumni <- Maryann yap 
-YAP query failed
-prover failed!!
- 
-===bad============ stateU.foundingAlumni <- Joe yap 
+===bad============ stateU.foundingAlumni <- Maryann
+YAP query failed
+prover failed!!
+ 
+===bad============ stateU.foundingAlumni <- Joe
 YAP query failed
 prover failed!!
@@ -132,5 +132,5 @@
 YAP dump succeed
  
-===good============ stateU.foundingAlumni <- Bob yap 
+===good============ stateU.foundingAlumni <- Bob
 YAP query succeed
 prover success!!
@@ -139,17 +139,17 @@
  pStateU.diploma('mathmatics',1961)  <- pBob 
  
-===bad============ stateU.foundingAlumni <- Mark yap 
-YAP query failed
-prover failed!!
- 
-===bad============ stateU.foundingAlumni <- Joe yap 
-YAP query failed
-prover failed!!
- 
-===bad============ stateU.foundingAlumni <- Maryann yap 
-YAP query failed
-prover failed!!
- 
-===good============ stateU.foundingAlumni <- Jan yap 
+===bad============ stateU.foundingAlumni <- Mark
+YAP query failed
+prover failed!!
+ 
+===bad============ stateU.foundingAlumni <- Joe
+YAP query failed
+prover failed!!
+ 
+===bad============ stateU.foundingAlumni <- Maryann
+YAP query failed
+prover failed!!
+ 
+===good============ stateU.foundingAlumni <- Jan
 YAP query succeed
 prover success!!
@@ -161,9 +161,9 @@
 YAP dump succeed
  
-===bad============ stateU.foundingAlumni <- Bob yap 
-YAP query failed
-prover failed!!
- 
-===good============ stateU.foundingAlumni <- Maryann yap 
+===bad============ stateU.foundingAlumni <- Bob
+YAP query failed
+prover failed!!
+ 
+===good============ stateU.foundingAlumni <- Maryann
 YAP query succeed
 prover success!!
@@ -172,5 +172,5 @@
  pStateU.diploma('psychology',1956)  <- pMaryann 
  
-===good============ stateU.foundingAlumni <- Joe yap 
+===good============ stateU.foundingAlumni <- Joe
 YAP query succeed
 prover success!!
@@ -182,5 +182,5 @@
 YAP dump succeed
  
-===good============ league.stadium(access,true,20120128T130000)<-?-john  yap 
+===good============ league.stadium(access,true,20120128T130000)<-?-john
 YAP query succeed
 prover success!!
@@ -190,9 +190,9 @@
  pLeague.players('north')  <- pJohn 
  
-===bad============ league.stadium(access,true,20120128T110000)<-?-mark  yap 
-YAP query failed
-prover failed!!
- 
-===good============ league.stadium(access,true,20120128T080000)<-?-mark  yap 
+===bad============ league.stadium(access,true,20120128T110000)<-?-mark
+YAP query failed
+prover failed!!
+ 
+===good============ league.stadium(access,true,20120128T080000)<-?-mark
 YAP query succeed
 prover success!!
@@ -204,5 +204,5 @@
 YAP dump succeed
  
-===good============ USC.evaluatorOf(Maryann) <- John yap 
+===good============ USC.evaluatorOf(Maryann) <- John
 YAP query succeed
 prover success!!
@@ -212,5 +212,5 @@
  pISI.managerOf(pMaryann)  <- pJohn 
  
-===good============ ISI.managerOf(Maryann) <- John yap 
+===good============ ISI.managerOf(Maryann) <- John
 YAP query succeed
 prover success!!
@@ -218,5 +218,5 @@
  pISI.managerOf(pMaryann)  <- pJohn 
  
-===good============  USC.employee <-?- John yap  
+===good============  USC.employee <-?- John
 YAP query succeed
 prover success!!
@@ -228,5 +228,5 @@
 YAP dump succeed
  
-===good=============== Globotron.admin <- Alice yap 
+===good=============== Globotron.admin <- Alice
 YAP query succeed
 prover success!!
@@ -234,9 +234,9 @@
  pGlobotron.admin  <- pAlice 
  
-===bad=============== Globotron.admin <- Bob yap 
-YAP query failed
-prover failed!!
- 
-===good=============== Acme.experiment_create <- Bob yap 
+===bad=============== Globotron.admin <- Bob
+YAP query failed
+prover failed!!
+ 
+===good=============== Acme.experiment_create <- Bob
 YAP query succeed
 prover success!!
@@ -251,5 +251,5 @@
 YAP dump succeed
  
-===good============ alpha.read(fileA) <- Bob yap 
+===good============ alpha.read(fileA) <- Bob
 YAP query succeed
 prover success!!
@@ -259,5 +259,5 @@
  pAlpha.managerOf(pJoe)  <- pBob 
  
-===bad============ alpha.read(fileA) <- Maryann yap 
+===bad============ alpha.read(fileA) <- Maryann
 YAP query failed
 prover failed!!
@@ -266,5 +266,5 @@
 YAP dump succeed
  
-===good============ mary.what2eat <- navel orange yap 
+===good============ mary.what2eat <- navel orange
 YAP query succeed
 prover success!!
@@ -273,5 +273,5 @@
  pRalphs.fruitprice(0.50)  <- 'navel orange' 
  
-===good============ mary.what2eat <- kiwi yap 
+===good============ mary.what2eat <- kiwi
 YAP query succeed
 prover success!!
@@ -280,9 +280,9 @@
  pRalphs.fruitprice(1.50)  <- 'kiwi' 
  
-===bad============ bob.what2eat <- navel orange yap 
-YAP query failed
-prover failed!!
- 
-===good============ ralphs.fruitprice(1.50) <- apple yap 
+===bad============ bob.what2eat <- navel orange
+YAP query failed
+prover failed!!
+ 
+===good============ ralphs.fruitprice(1.50) <- apple
 YAP query succeed
 prover success!!
@@ -290,5 +290,5 @@
  pRalphs.fruitprice(1.50)  <- 'apple' 
  
-===bad============ ralphs.fruitprice(1.50) <- green apple yap 
-YAP query failed
-prover failed!!
+===bad============ ralphs.fruitprice(1.50) <- green apple
+YAP query failed
+prover failed!!
Index: examples/alumni2_rt1_typed/README
===================================================================
--- examples/alumni2_rt1_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/alumni2_rt1_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,4 +1,4 @@
 #!/bin/sh
-
+#
 # This example shows an example of reasoning about a role's parameters.  There
 # are 4 principals StateU, Bob, Maryann, and Joe.  StateU wants to establish a
@@ -14,8 +14,9 @@
 # psychology degree).
 #
-# The attached ./rr file asks if each of these principals are favored alums,
-# and only Bob is.
+# The attached ./run_query file asks if each of these principals are favored
+# alums, and only Bob is.
 
-rm -rf *.der *.pem
+# alumni2_rt1_typeD
+
 # [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
 # [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
Index: examples/alumni2_rt1_typed/rr
===================================================================
--- examples/alumni2_rt1_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,41 +1,0 @@
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-stateU=`creddy --keyid --cert $keyloc/StateU_ID.pem`
-bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
-maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem`
-joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
-
-stateU_foundingAlumni="[keyid:$stateU].role:foundingAlumni"
-bob_prin="[keyid:$bob]"
-maryann_prin="[keyid:$maryann]"
-joe_prin="[keyid:$joe]"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no)
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
-echo " "
-echo "===good============ stateU.foundingAlumni <- Bob yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$bob_prin"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
-# asking, isMember(pMaryann,role(pStateU,foundingAlumni),C).
-echo " "
-echo "===bad============ stateU.foundingAlumni <- Maryann yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$maryann_prin"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no)
-echo " "
-echo "===bad============ stateU.foundingAlumni <- Joe yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$joe_prin"
-
-
Index: examples/alumni2_rt1_typed/run_query
===================================================================
--- examples/alumni2_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/alumni2_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,42 @@
+
+# alumni2_rt1_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+stateU=`creddy --keyid --cert $keyloc/StateU_ID.pem`
+bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
+maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem`
+joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
+
+stateU_foundingAlumni="[keyid:$stateU].role:foundingAlumni"
+bob_prin="[keyid:$bob]"
+maryann_prin="[keyid:$maryann]"
+joe_prin="[keyid:$joe]"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no)
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
+echo " "
+echo "===good============ stateU.foundingAlumni <- Bob"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$bob_prin"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
+# asking, isMember(pMaryann,role(pStateU,foundingAlumni),C).
+echo " "
+echo "===bad============ stateU.foundingAlumni <- Maryann"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$maryann_prin"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no)
+echo " "
+echo "===bad============ stateU.foundingAlumni <- Joe"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$joe_prin"
+
+
Index: examples/alumni3_rt1_typed/README
===================================================================
--- examples/alumni3_rt1_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/alumni3_rt1_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,4 +1,4 @@
 #!/bin/sh
-
+#
 # This example shows an example of reasoning about a role's parameters.  There
 # are 4 principals StateU, Bob, Mark, Maryann, Joe, and Jan.  StateU wants to
@@ -13,8 +13,8 @@
 # mathematics degree), Mark (a 1965 mathematics degree), Joe (a 1961 zoology degree), Maryann (a 1962 psychology degree), and Jan (a 1960 psychology degree)
 #
-# The attached ./rr file asks if each of these principals are favored alums,
-# and only Bob and Jan are.
+# The attached ./run_query file asks if each of these principals are favored
+# alums, and only Bob and Jan are.
 
-
+# alumni3_rt1_typed
 
 rm -rf *.der *.pem
Index: examples/alumni3_rt1_typed/rr
===================================================================
--- examples/alumni3_rt1_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,58 +1,0 @@
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-stateU=`creddy --keyid --cert $keyloc/StateU_ID.pem`
-
-bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
-mark=`creddy --keyid --cert $keyloc/Mark_ID.pem`
-joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
-maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem`
-jan=`creddy --keyid --cert $keyloc/Jan_ID.pem`
-
-stateU_foundingAlumni="[keyid:$stateU].role:foundingAlumni"
-bob_prin="[keyid:$bob]"
-maryann_prin="[keyid:$maryann]"
-joe_prin="[keyid:$joe]"
-mark_prin="[keyid:$mark]"
-jan_prin="[keyid:$jan]"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Mark] (no)
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no)
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Jan] (yes)
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
-echo " "
-echo "===good============ stateU.foundingAlumni <- Bob yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$bob_prin"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Mark] (no)
-echo " "
-echo "===bad============ stateU.foundingAlumni <- Mark yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$mark_prin"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no)
-echo " "
-echo "===bad============ stateU.foundingAlumni <- Joe yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$joe_prin"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
-# asking, isMember(pMaryann,role(pStateU,foundingAlumni),C).
-echo " "
-echo "===bad============ stateU.foundingAlumni <- Maryann yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$maryann_prin"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Jan] (yes)
-echo " "
-echo "===good============ stateU.foundingAlumni <- Jan yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$jan_prin"
-
-
Index: examples/alumni3_rt1_typed/run_query
===================================================================
--- examples/alumni3_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/alumni3_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,58 @@
+
+# alumni3_rt1_typed  
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+stateU=`creddy --keyid --cert $keyloc/StateU_ID.pem`
+
+bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
+mark=`creddy --keyid --cert $keyloc/Mark_ID.pem`
+joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
+maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem`
+jan=`creddy --keyid --cert $keyloc/Jan_ID.pem`
+
+stateU_foundingAlumni="[keyid:$stateU].role:foundingAlumni"
+bob_prin="[keyid:$bob]"
+maryann_prin="[keyid:$maryann]"
+joe_prin="[keyid:$joe]"
+mark_prin="[keyid:$mark]"
+jan_prin="[keyid:$jan]"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Mark] (no)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Jan] (yes)
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (yes)
+echo " "
+echo "===good============ stateU.foundingAlumni <- Bob"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$bob_prin"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Mark] (no)
+echo " "
+echo "===bad============ stateU.foundingAlumni <- Mark"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$mark_prin"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (no)
+echo " "
+echo "===bad============ stateU.foundingAlumni <- Joe"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$joe_prin"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (no)
+# asking, isMember(pMaryann,role(pStateU,foundingAlumni),C).
+echo " "
+echo "===bad============ stateU.foundingAlumni <- Maryann"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$maryann_prin"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Jan] (yes)
+echo " "
+echo "===good============ stateU.foundingAlumni <- Jan"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$jan_prin"
+
+
Index: examples/alumni_rt1_typed/README
===================================================================
--- examples/alumni_rt1_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/alumni_rt1_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,4 +1,4 @@
 #!/bin/sh
-
+#
 # This example shows an example of reasoning about a role's parameters.  There
 # are 4 principals StateU, Bob, Maryann, and Joe.  StateU wants to establish a
@@ -13,8 +13,8 @@
 # psychology degree).
 #
-# The attached ./rr file asks if each of these principals are favored alums,
-# and Joe and MAryann are.
+# The attached ./run_query file asks if each of these principals are favored
+# alums and Joe and Maryann are.
 
-rm -rf *.der *.pem
+# alumni_rt1_typed
 
 # [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (no)
Index: examples/alumni_rt1_typed/rr
===================================================================
--- examples/alumni_rt1_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,40 +1,0 @@
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-stateU=`creddy --keyid --cert $keyloc/StateU_ID.pem`
-bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
-maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem`
-joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
-
-stateU_foundingAlumni="[keyid:$stateU].role:foundingAlumni"
-bob_prin="[keyid:$bob]"
-maryann_prin="[keyid:$maryann]"
-joe_prin="[keyid:$joe]"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (no)
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (yes)
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (no)
-echo " "
-echo "===bad============ stateU.foundingAlumni <- Bob yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$bob_prin"
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (yes)
-# asking, isMember(pMaryann,role(pStateU,foundingAlumni),C).
-echo " "
-echo "===good============ stateU.foundingAlumni <- Maryann yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$maryann_prin"
-
-
-# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (yes)
-echo " "
-echo "===good============ stateU.foundingAlumni <- Joe yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$joe_prin"
-
Index: examples/alumni_rt1_typed/run_query
===================================================================
--- examples/alumni_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/alumni_rt1_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,41 @@
+
+# alumni_rt1_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+stateU=`creddy --keyid --cert $keyloc/StateU_ID.pem`
+bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
+maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem`
+joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
+
+stateU_foundingAlumni="[keyid:$stateU].role:foundingAlumni"
+bob_prin="[keyid:$bob]"
+maryann_prin="[keyid:$maryann]"
+joe_prin="[keyid:$joe]"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (no)
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (yes)
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Bob] (no)
+echo " "
+echo "===bad============ stateU.foundingAlumni <- Bob"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$bob_prin"
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Maryann] (yes)
+# asking, isMember(pMaryann,role(pStateU,foundingAlumni),C).
+echo " "
+echo "===good============ stateU.foundingAlumni <- Maryann"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$maryann_prin"
+
+
+# [keyid:stateU].role:foundingAlumni <-?- [keyid:Joe] (yes)
+echo " "
+echo "===good============ stateU.foundingAlumni <- Joe"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stateU_foundingAlumni" --principal "$joe_prin"
+
Index: examples/balltime_rt2_typed/README
===================================================================
--- examples/balltime_rt2_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/balltime_rt2_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,4 +1,4 @@
 #!/bin/sh
-
+#
 #####################################################################
 # This example demonstrates using an oset (object set) to control access
@@ -25,10 +25,10 @@
 # a player for team(south)
 #
-# The attached ./rr file runs 3 queries.  First it confirms that John can 
+# The attached ./run_query 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
+# balltime_rt2_typed
 
 creddy --generate --cn League
Index: examples/balltime_rt2_typed/rr
===================================================================
--- examples/balltime_rt2_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,37 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-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'],[boolean:true],[time:20120228T130000])"
-stadium_accessT2="[keyid:$league].role:stadium([string:'access'],[boolean:true],[time:20120228T110000])"
-stadium_accessT3="[keyid:$league].role:stadium([string:'access'],[boolean:true],[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'],[boolean:true],[time:20120228T130000]) <-?- [keyid:john] (yes)
-echo " "
-echo "===good============ league.stadium(access,true,20120128T130000)<-?-john  yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT" --principal "$john_prin"
-
-#[keyid:$league].role:stadium([string:'access'],[boolean:true],[time:20120228T110000]) <-?- [keyid:mark] (no)
-echo " "
-echo "===bad============ league.stadium(access,true,20120128T110000)<-?-mark  yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT2" --principal "$mark_prin"
-
-#[keyid:$league].role:stadium([string:'access'],[boolean:true],[time:20120228T080000]) <-?- [keyid:mark] (yes)
-echo " "
-echo "===good============ league.stadium(access,true,20120128T080000)<-?-mark  yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT3" --principal "$mark_prin"
-
Index: examples/balltime_rt2_typed/run_query
===================================================================
--- examples/balltime_rt2_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/balltime_rt2_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,37 @@
+
+# balltime_rt2_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+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'],[boolean:true],[time:20120228T130000])"
+stadium_accessT2="[keyid:$league].role:stadium([string:'access'],[boolean:true],[time:20120228T110000])"
+stadium_accessT3="[keyid:$league].role:stadium([string:'access'],[boolean:true],[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'],[boolean:true],[time:20120228T130000]) <-?- [keyid:john] (yes)
+echo " "
+echo "===good============ league.stadium(access,true,20120128T130000)<-?-john"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT" --principal "$john_prin"
+
+#[keyid:$league].role:stadium([string:'access'],[boolean:true],[time:20120228T110000]) <-?- [keyid:mark] (no)
+echo " "
+echo "===bad============ league.stadium(access,true,20120128T110000)<-?-mark"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT2" --principal "$mark_prin"
+
+#[keyid:$league].role:stadium([string:'access'],[boolean:true],[time:20120228T080000]) <-?- [keyid:mark] (yes)
+echo " "
+echo "===good============ league.stadium(access,true,20120128T080000)<-?-mark"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$stadium_accessT3" --principal "$mark_prin"
+
Index: examples/evaluator_rt1_typed/README
===================================================================
--- examples/evaluator_rt1_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/evaluator_rt1_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,6 +1,4 @@
 #!/bin/sh
-
-rm -rf *.pem *.der
-
+#
 # This example demonstrates linking parameterized roles and delegating across
 # institutions.  There are 4 principals USC, ISI, John, and Maryann.  USC and
@@ -14,7 +12,9 @@
 # credentials 5 and 6 idicate that John and Maryann are ISI employees.
 # 
-# the attached ./rr script queries that USC grants John the role of evaluator
+# the attached ./run_query script queries that USC grants John the role of evaluator
 # of Maryann, that ISI asserts John is Maryann's manager and that John is an
 # ISI employee.
+
+# evaluator_rt1_typed
 
 #[keyid:USC].role:employee <-?- [keyid:John]
Index: examples/evaluator_rt1_typed/rr
===================================================================
--- examples/evaluator_rt1_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,39 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-isi=`creddy --keyid --cert ISI_ID.pem`
-usc=`creddy --keyid --cert USC_ID.pem`
-maryann=`creddy --keyid --cert Maryann_ID.pem`
-john=`creddy --keyid --cert John_ID.pem`
-
-usc_employee="[keyid:$usc].role:employee"
-usc_eval_maryann="[keyid:$usc].role:evaluatorOf([keyid:$maryann])"
-isi_manager_maryann="[keyid:$isi].role:managerOf([keyid:$maryann])"
-john_prin="[keyid:$john]"
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-#[keyid:USC].role:evaluatorOf([keyid:Maryann]) <-?- [keyid:John] yap
-echo " "
-echo "===good============ USC.evaluatorOf(Maryann) <- John yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$usc_eval_maryann" --principal "$john_prin"
-
-#[keyid:ISI].role:managerOf([keyid:Maryann]) <-?- [keyid:John] yap
-echo " "
-echo "===good============ ISI.managerOf(Maryann) <- John yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$isi_manager_maryann" --principal "$john_prin"
-
-
-#[keyid:USC].role:employee <- [keyid:John] yap "
-#USC.employee <-?- John yap
-echo " "
-echo "===good============  USC.employee <-?- John yap  "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$usc_employee" --principal "$john_prin"
-
-
Index: examples/experiment_create_rt0_typed/README
===================================================================
--- examples/experiment_create_rt0_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/experiment_create_rt0_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,6 +1,4 @@
 #!/bin/sh
-
-rm -rf *.der *.pem
-
+#
 #
 #Acme runs a testbed. They've delegated the authority to create
@@ -27,4 +25,6 @@
 #above and the attribute certificates below.
 #
+
+# experiment_create_rt0_typed 
 
 creddy --generate --cn Acme
Index: examples/experiment_create_rt0_typed/rr
===================================================================
--- examples/experiment_create_rt0_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,43 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
-alice=`creddy --keyid --cert $keyloc/Alice_ID.pem`
-bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
-globotron=`creddy --keyid --cert $keyloc/Globotron_ID.pem`
-
-glob_admin="[keyid:$globotron].role:admin"
-alice_prin="[keyid:$alice]"
-bob_prin="[keyid:$bob]"
-experiment_create="[keyid:$acme].role:experiment_create"
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-#[keyid:Globotron].role:admin <-?- [keyid:Alice] yap
-#isMember(pAlice, role(pGlobotron,admin), C).
-echo " "
-echo "===good=============== Globotron.admin <- Alice yap "
-$eloc/abac_prover_yap  --keystore $keyloc \
-             --role "$glob_admin" --principal "$alice_prin"
-
-#[keyid:Globotron].role:admin <-?- [keyid:Bob] yap
-#isMember(pBob, role(pGlobotron,admin), C).
-echo " "
-echo "===bad=============== Globotron.admin <- Bob yap "
-$eloc/abac_prover_yap  --keystore $keyloc \
-             --role "$glob_admin" --principal "$bob_prin"
-
-#[keyid:Acme].role:experiment_create <-?- [keyid:Bob] yap
-#isMember(pBob, role(pAcme,experiment_create), C).
-echo " "
-echo "===good=============== Acme.experiment_create <- Bob yap "
-$eloc/abac_prover_yap  --keystore $keyloc \
-             --role "$experiment_create" --principal "$bob_prin"
-
-
Index: examples/experiment_create_rt0_typed/run_query
===================================================================
--- examples/experiment_create_rt0_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/experiment_create_rt0_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,43 @@
+
+# experiment_create_rt0_typed 
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
+alice=`creddy --keyid --cert $keyloc/Alice_ID.pem`
+bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
+globotron=`creddy --keyid --cert $keyloc/Globotron_ID.pem`
+
+glob_admin="[keyid:$globotron].role:admin"
+alice_prin="[keyid:$alice]"
+bob_prin="[keyid:$bob]"
+experiment_create="[keyid:$acme].role:experiment_create"
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:Globotron].role:admin <-?- [keyid:Alice]
+#isMember(pAlice, role(pGlobotron,admin), C).
+echo " "
+echo "===good=============== Globotron.admin <- Alice"
+$eloc/abac_prover_yap  --keystore $keyloc \
+             --role "$glob_admin" --principal "$alice_prin"
+
+#[keyid:Globotron].role:admin <-?- [keyid:Bob]
+#isMember(pBob, role(pGlobotron,admin), C).
+echo " "
+echo "===bad=============== Globotron.admin <- Bob"
+$eloc/abac_prover_yap  --keystore $keyloc \
+             --role "$glob_admin" --principal "$bob_prin"
+
+#[keyid:Acme].role:experiment_create <-?- [keyid:Bob]
+#isMember(pBob, role(pAcme,experiment_create), C).
+echo " "
+echo "===good=============== Acme.experiment_create <- Bob"
+$eloc/abac_prover_yap  --keystore $keyloc \
+             --role "$experiment_create" --principal "$bob_prin"
+
+
Index: examples/file_read_rt2_typed/README
===================================================================
--- examples/file_read_rt2_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/file_read_rt2_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,5 +1,4 @@
 #!/bin/sh
-
-rm -rf *.der *.pem
+#
 #####################################################################
 # This example demonstrates using a parameters to control access to files based
@@ -17,9 +16,10 @@
 # The example below lays out the policy that the manager of the owner of a file
 # can read it in Credential 1. Credential 2 establishes Bob as the manager of
-# Joe. and Credential 3 establishes Joe as the woner fo the file.
+# Joe. and Credential 3 establishes Joe as the owner of the file.
 #
-# The attached ./rr file runs 2 queries.  First it confirms that Bob can read
+# The attached ./run_query file runs 2 queries.  First it confirms that Bob can read
 # fileA, then it confirms that Maryann cannot. 
 
+# file_read_rt2_typed
 
 # alpha.read(fileA) <-?- Bob
@@ -45,4 +45,5 @@
 # [keyid:alpha].role:read([urn:?F])<-
 #    [keyid:alpha].role:managerOf([principal:?E[keyid:alpha].role:ownerOf([urn:?F])]
+# Credential 1
 creddy --attribute \
        --issuer Alpha_ID.pem --key Alpha_private.pem --role "read([urn:?F])" \
@@ -50,4 +51,5 @@
        --out Alpha_read_qF__alpha_managerof_qE_attr.der
 
+# Credential 2
 #[keyid:Alpha].role:managerOf([Keyid:Joe]) <- [keyid:Bob]
 creddy --attribute \
@@ -56,4 +58,5 @@
         --out Alpha_managerof_Joe__Bob_attr.der
 
+# Credential 3
 #[keyid:Alpha].role:ownerOf([urn:'file://fileA']) <- [keyid:Joe]
 creddy --attribute \
Index: examples/file_read_rt2_typed/rr
===================================================================
--- examples/file_read_rt2_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,30 +1,0 @@
-
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-alpha=`creddy --keyid --cert $keyloc/Alpha_ID.pem`
-bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
-maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem`
-alpha=`creddy --keyid --cert $keyloc/Alpha_ID.pem`
-
-read_fileA="[keyid:$alpha].role:read([urn:'file://fileA'])"
-bob_prin="[keyid:$bob]"
-maryann_prin="[keyid:$maryann]"
-
-## dump all credentials -- does not seem to work
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-#[keyid:Alpha].role:read([urn:'file://fileA']) <-?- [keyid:Bob] (yes)
-echo " "
-echo "===good============ alpha.read(fileA) <- Bob yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$read_fileA" --principal "$bob_prin"
-
-#[keyid:Alpha].role:read([urn:'file://fileA']) <-?- [keyid:Maryann] (no)
-echo " "
-echo "===bad============ alpha.read(fileA) <- Maryann yap "
-$eloc/abac_prover_yap  --keystore $keyloc --role "$read_fileA" --principal "$maryann_prin"
-
Index: examples/file_read_rt2_typed/run_query
===================================================================
--- examples/file_read_rt2_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/file_read_rt2_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,30 @@
+
+# file_read_rt2_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+alpha=`creddy --keyid --cert $keyloc/Alpha_ID.pem`
+bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
+maryann=`creddy --keyid --cert $keyloc/Maryann_ID.pem`
+alpha=`creddy --keyid --cert $keyloc/Alpha_ID.pem`
+
+read_fileA="[keyid:$alpha].role:read([urn:'file://fileA'])"
+bob_prin="[keyid:$bob]"
+maryann_prin="[keyid:$maryann]"
+
+## dump all credentials -- 
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#[keyid:Alpha].role:read([urn:'file://fileA']) <-?- [keyid:Bob] (yes)
+echo " "
+echo "===good============ alpha.read(fileA) <- Bob"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$read_fileA" --principal "$bob_prin"
+
+#[keyid:Alpha].role:read([urn:'file://fileA']) <-?- [keyid:Maryann] (no)
+echo " "
+echo "===bad============ alpha.read(fileA) <- Maryann"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$read_fileA" --principal "$maryann_prin"
+
Index: examples/fruits_rt2_typed/README
===================================================================
--- examples/fruits_rt2_typed/README	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/fruits_rt2_typed/README	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -1,6 +1,4 @@
 #!/bin/sh
-
-rm -rf *.der *.pem
-
+#
 # This demonstrates assigning objects to object sets (osets) based on their
 # membership in other sets.  In this case there are 3 prinicpals. Mary and Bob
@@ -20,8 +18,10 @@
 # navel ornage        0.50       6
 #
-# The attached ./rr file proves that Mary will eat a naval orange and a kiwi,
+# The attached ./run_query file proves that Mary will eat a naval orange and a kiwi,
 # and that Bob will not eat a navel orange (too cheap).  It also proves a apple
 # is priced at 1.50 and that it cannot prove that a green apple is priced at
 # 1.50 (we don't know anything about green apples).
+
+# fruits_rt2_typed
 
 # mary.what2eat<-?-navel orange  good
@@ -29,4 +29,5 @@
 # bob.what2eat<-?-navel orange  bad
 # ralphs.fruitprice(1.50)<-?-apple   good
+# ralphs.fruitprice(1.50)<-?-green apple   bad
 
 creddy --generate --cn Mary
Index: examples/fruits_rt2_typed/rr
===================================================================
--- examples/fruits_rt2_typed/rr	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ 	(revision )
@@ -1,45 +1,0 @@
-rm -rf creds_dump
-
-pwd=`pwd`
-
-eloc=$pwd/../../libabac
-keyloc=$pwd
-
-ralphs=`creddy --keyid --cert $keyloc/Ralphs_ID.pem`
-bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
-mary=`creddy --keyid --cert $keyloc/Mary_ID.pem`
-
-mary_what2eat="[keyid:$mary].oset:what2eat"
-bob_what2eat="[keyid:$bob].oset:what2eat"
-ralphs_apple="[keyid:$ralphs].oset:fruitprice([float:1.50])"
-
-## dump all credentials
-$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
-
-# [keyid:mary].oset:what2eat <-?- [string:'navel orange'] (yes)
-echo " "
-echo "===good============ mary.what2eat <- navel orange yap "
-$eloc/abac_prover_yap  --keystore $keyloc --oset "$mary_what2eat" --object "[string:'navel orange']"
-
-# [keyid:mary].oset:what2eat <-?- [string:'kiwi'] (yes)
-echo " "
-echo "===good============ mary.what2eat <- kiwi yap "
-$eloc/abac_prover_yap  --keystore $keyloc --oset "$mary_what2eat" --object "[string:'kiwi']"
-
-# [keyid:bob].oset:what2eat <-?- [string:'navel orange'] (no)
-echo " "
-echo "===bad============ bob.what2eat <- navel orange yap "
-$eloc/abac_prover_yap  --keystore $keyloc --oset "$bob_what2eat" --object "[string:'navel orange']"
-
-# [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'apple'] (yes)
-echo " "
-echo "===good============ ralphs.fruitprice(1.50) <- apple yap "
-$eloc/abac_prover_yap  --keystore $keyloc --oset "$ralphs_apple" --object "[string:'apple']"
-
-
-# [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'green apple'] (no)
-echo " "
-echo "===bad============ ralphs.fruitprice(1.50) <- green apple yap "
-$eloc/abac_prover_yap  --keystore $keyloc --oset "$ralphs_apple" --object "[string:'green apple']"
-
-
Index: examples/fruits_rt2_typed/run_query
===================================================================
--- examples/fruits_rt2_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
+++ examples/fruits_rt2_typed/run_query	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -0,0 +1,45 @@
+
+# fruits_rt2_typed
+
+pwd=`pwd`
+
+eloc=$pwd/../../libabac
+keyloc=$pwd
+
+ralphs=`creddy --keyid --cert $keyloc/Ralphs_ID.pem`
+bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
+mary=`creddy --keyid --cert $keyloc/Mary_ID.pem`
+
+mary_what2eat="[keyid:$mary].oset:what2eat"
+bob_what2eat="[keyid:$bob].oset:what2eat"
+ralphs_apple="[keyid:$ralphs].oset:fruitprice([float:1.50])"
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+# [keyid:mary].oset:what2eat <-?- [string:'navel orange'] (yes)
+echo " "
+echo "===good============ mary.what2eat <- navel orange"
+$eloc/abac_prover_yap  --keystore $keyloc --oset "$mary_what2eat" --object "[string:'navel orange']"
+
+# [keyid:mary].oset:what2eat <-?- [string:'kiwi'] (yes)
+echo " "
+echo "===good============ mary.what2eat <- kiwi"
+$eloc/abac_prover_yap  --keystore $keyloc --oset "$mary_what2eat" --object "[string:'kiwi']"
+
+# [keyid:bob].oset:what2eat <-?- [string:'navel orange'] (no)
+echo " "
+echo "===bad============ bob.what2eat <- navel orange"
+$eloc/abac_prover_yap  --keystore $keyloc --oset "$bob_what2eat" --object "[string:'navel orange']"
+
+# [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'apple'] (yes)
+echo " "
+echo "===good============ ralphs.fruitprice(1.50) <- apple"
+$eloc/abac_prover_yap  --keystore $keyloc --oset "$ralphs_apple" --object "[string:'apple']"
+
+# [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'green apple'] (no)
+echo " "
+echo "===bad============ ralphs.fruitprice(1.50) <- green apple"
+$eloc/abac_prover_yap  --keystore $keyloc --oset "$ralphs_apple" --object "[string:'green apple']"
+
+
Index: examples/runall
===================================================================
--- examples/runall	(revision 7727f26afdaff81acebfc2f0d5e4baef296aaf29)
+++ examples/runall	(revision 23d639a14c5a2104a7e869ef089a17451064b7e5)
@@ -4,5 +4,5 @@
 #   runall clean
 #   runall README
-#   runall rr
+#   runall run_query
 
 progname=$(basename $0)
@@ -21,8 +21,8 @@
        elif [ "$1" = "setup" ]; then
            printf "\n ==> SETUP on %s\n" "$i"  >& 2;
-           README
+           ./README
        elif [ "$1" = "run" ] ; then
            printf "\n ==> RUN on %s\n" "$i" ;
-           rr
+           ./run_query 
        fi 
        cd ..;
