Index: examples/creddy_prover_tests/leader_rt1/README
===================================================================
--- examples/creddy_prover_tests/leader_rt1/README	(revision 5110d428b9de9f6ec063a033dfe605950456dc4f)
+++ examples/creddy_prover_tests/leader_rt1/README	(revision 5110d428b9de9f6ec063a033dfe605950456dc4f)
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# This example shows a way to allow an user with multiple keyid identities 
+# to be 'reasoned' as one within a single scope.  There are 4 principals 
+# Geni, Bob, Jack, and Joe. Bob and Joe are actually the same person but 
+# not Jack.
+#
+# Credentials 1 is the policy that says a principal is a group leader
+# at Geni if it is equivalent to another principal who is a group 
+# leader at Geni. 
+#
+# Credentials 2 establishes Bob as a group leader at Geni while
+# credential 3 and 4 are the equivalent rules between Bob and Joe.
+#
+# The attached ./run_query file asks if Joe is also an group leader which
+# he is because there is a equivalent rule from Bob to him. It also asks
+# if Jack is a group leader which he isn't because there is no equivalent
+# rule from Bob to him.
+
+# leader_rt1_typed
+
+# [keyid:geni].role:leader <-?- [keyid:Bob] (yes)
+# [keyid:geni].role:leader <-?- [keyid:Jack] (no)
+# [keyid:geni].role:leader <-?- [keyid:Joe] (yes)
+
+creddy --generate --cn Geni
+creddy --generate --cn Bob
+creddy --generate --cn Jack
+creddy --generate --cn Joe
+
+geni_keyid=`creddy --keyid --cert Geni_ID.pem`
+bob_keyid=`creddy --keyid --cert Bob_ID.pem`
+jack_keyid=`creddy --keyid --cert Jack_ID.pem`
+joe_keyid=`creddy --keyid --cert Joe_ID.pem`
+
+leader_qP="equivalent([principal:?P[keyid:$geni_keyid].role:leader])"
+equivalent_bob="equivalent([keyid:$bob_keyid])"
+equivalent_joe="equivalent([keyid:$joe_keyid])"
+
+# [keyid:geni].role:leader 
+#         <- [keyid:geni].role:equivalent([principal:?P[keyid:geni].role:leader])
+# Credential 1
+/home/mei/Deter/abac/creddy/creddy --attribute \
+       --issuer Geni_ID.pem --key Geni_private.pem --role "leader" \
+       --subject-cert Geni_ID.pem --subject-role "$leader_qP" \
+       --out geni_leader__geni_leader_qP_attr.der
+
+# [keyid:geni].role:leader <- [keyid:bob]
+# Credential 2
+creddy --attribute \
+        --issuer Geni_ID.pem --key Geni_private.pem --role "leader" \
+        --subject-cert Bob_ID.pem \
+        --out geni_leader__Bob_attr.der
+
+# [keyid:geni].role:equivalent([keyid:bob]) <- [keyid:Joe]
+# Credential 3
+creddy --attribute \
+        --issuer Geni_ID.pem --key Geni_private.pem --role "$equivalent_bob" \
+        --subject-cert Joe_ID.pem \
+        --out geni_equivalent_Bob__Joe_attr.der
+
+# [keyid:geni].role:equivalent([keyid:Joe]) <- [keyid:Bob]
+# Credential 4
+creddy --attribute \
+        --issuer Geni_ID.pem --key Geni_private.pem --role "$equivalent_joe" \
+        --subject-cert Bob_ID.pem \
+        --out geni_equivalent_Joe__Bob_attr.der
+
Index: examples/creddy_prover_tests/leader_rt1/run_query
===================================================================
--- examples/creddy_prover_tests/leader_rt1/run_query	(revision 5110d428b9de9f6ec063a033dfe605950456dc4f)
+++ examples/creddy_prover_tests/leader_rt1/run_query	(revision 5110d428b9de9f6ec063a033dfe605950456dc4f)
@@ -0,0 +1,43 @@
+
+# leader_rt1_typed
+
+pwd=`pwd`
+
+eloc=${ABAC_PROVER_PATH}
+keyloc=$pwd
+
+geni=`creddy --keyid --cert $keyloc/Geni_ID.pem`
+bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
+jack=`creddy --keyid --cert $keyloc/Jack_ID.pem`
+joe=`creddy --keyid --cert $keyloc/Joe_ID.pem`
+
+geni_leader="[keyid:$geni].role:leader"
+bob_prin="[keyid:$bob]"
+jack_prin="[keyid:$jack]"
+joe_prin="[keyid:$joe]"
+
+# [keyid:geni].role:leader <-?- [keyid:Bob] (yes)
+# [keyid:geni].role:leader <-?- [keyid:Jack] (no)
+# [keyid:geni].role:leader <-?- [keyid:Joe] (yes)
+
+## dump all credentials
+$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
+
+#double checking 
+#creddy --roles --cert geni_leader__geni_leader_qP_attr.der
+
+# [keyid:geni].role:leader <-?- [keyid:Bob] (yes)
+echo " "
+echo "===yes============ geni.leader <- Bob"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$geni_leader" --principal "$bob_prin"
+
+# [keyid:geni].role:leader <-?- [keyid:Jack] (no)
+echo " "
+echo "===no============ geni.leader <- Jack"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$geni_leader" --principal "$jack_prin"
+
+# [keyid:geni].role:leader <-?- [keyid:Joe] (yes)
+echo " "
+echo "===yes============ geni.leader <- Joe"
+$eloc/abac_prover_yap  --keystore $keyloc --role "$geni_leader" --principal "$joe_prin"
+
