Index: examples/scaling_tests/haystack/fruit_prover/base/QUERY
===================================================================
--- examples/scaling_tests/haystack/fruit_prover/base/QUERY	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
+++ examples/scaling_tests/haystack/fruit_prover/base/QUERY	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
@@ -0,0 +1,45 @@
+
+# fruits_rt2_typed
+
+pwd=`pwd`
+
+eloc=${ABAC_PROVER_PATH}
+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/scaling_tests/haystack/fruit_prover/base/README
===================================================================
--- examples/scaling_tests/haystack/fruit_prover/base/README	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
+++ examples/scaling_tests/haystack/fruit_prover/base/README	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
@@ -0,0 +1,104 @@
+#!/bin/sh
+#
+#  This demonstrates scalability of libabac. The fruit_rt2 test from 
+#  creddy_prover_tests is use as the base. 
+#       #VAL# simple attribute credentials are added, 
+#       #VAL# complex attribute credentials along 
+#             with #VAL# different principal ids are added.
+#  The same queries used in fruit_rt2 are run against this setup and 
+#  should  yield the same result
+
+# fruits_rt2_creddy
+
+# mary.what2eat<-?-navel orange  good
+# mary.what2eat<-?-kiwi  good
+# bob.what2eat<-?-navel orange  bad
+# ralphs.fruitprice(1.50)<-?-apple   good
+# ralphs.fruitprice(1.50)<-?-green apple   bad
+
+creddy --generate --cn Mary
+creddy --generate --cn Bob
+creddy --generate --cn Ralphs
+
+fruitprice_qP="fruitprice([float:?P:[..2.00]])"
+fruitprice_qP_2="fruitprice([float:?P:[1.00..5.00]])"
+
+# [keyid:mary].oset:what2eat 
+#      <- [keyid:ralphs].oset:fruitprice([float:?P:[..2.00]])
+# Credential 1
+creddy --attribute \
+       --issuer Mary_ID.pem --key Mary_private.pem --oset "what2eat" \
+       --subject-cert Ralphs_ID.pem --subject-oset "$fruitprice_qP" \
+       --out mary_what2eat__ralphs_fruitprice_qP_attr.der
+
+# [keyid:bob].oset:what2eat 
+#      <- [keyid:ralphs].oset:fruitprice([float:?P:[1.00..5.00]])
+# Credential 2
+creddy --attribute \
+       --issuer Bob_ID.pem --key Bob_private.pem --oset "what2eat" \
+       --subject-cert Ralphs_ID.pem --subject-oset "$fruitprice_qP_2" \
+       --out bob_what2eat__ralphs_fruitprice_qP_2_attr.der
+
+# [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'apple']
+# Credential 3
+creddy --attribute \
+        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
+        --oset "fruitprice([float:1.50])" \
+        --subject-obj "[string:'apple']" \
+        --out Ralphs_fruitprice__apple_attr.der
+
+# [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'kiwi']
+# Credential 4
+creddy --attribute \
+        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
+        --oset "fruitprice([float:1.50])" \
+        --subject-obj "[string:'kiwi']" \
+        --out Ralphs_fruitprice__kiwi_attr.der
+
+
+# [keyid:ralphs].oset:fruitprice([float:2.50]) <- [string:'black rasberry']
+# Credential 5
+creddy --attribute \
+        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
+        --oset "fruitprice([float:2.50])" \
+        --subject-obj "[string:'black rasberry']" \
+        --out Ralphs_fruitprice__black_rasberry_attr.der
+
+# [keyid:ralphs].oset:fruitprice([float:0.50]) <- [string:'navel orange']
+# Credential 6
+creddy --attribute \
+        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
+        --oset "fruitprice([float:0.50])" \
+        --subject-obj "[string:'navel orange']" \
+        --out Ralphs_fruitprice__navel_orange_attr.der
+
+############### NOISE #######################################
+# [keyid:Ralphs].oset:fruitprice([float:X.00])  <- [string:bananaY]
+for i in $(seq 1 #VAL#);
+do
+  fruit="banana$i"
+  price="fruitprice([float:$i.00])"
+  stuff="[string:'$fruit']"
+  ostr="Ralphs_fruitprice__${fruit}_attr.der"
+  creddy --attribute \
+        --issuer Ralphs_ID.pem --key Ralphs_private.pem \
+        --oset "$price" \
+        --subject-obj "$stuff" \
+        --out $ostr
+done
+
+# [keyid:johnX]
+# [keyid:johnX].oset:what2eat 
+#               <- [keyid:ralphs].oset:fruitprice([float:?P:[1.00..5.00]])
+for i in $(seq 1 #VAL#);
+do
+  name="John$i"
+creddy --generate --cn $name 
+
+  ostr="${name}_what2eat__ralphs_fruitprice_qP_2_attr.der"
+creddy --attribute \
+       --issuer ${name}_ID.pem --key ${name}_private.pem --oset "what2eat" \
+       --subject-cert Ralphs_ID.pem --subject-oset "$fruitprice_qP_2" \
+       --out $ostr
+done
+
Index: examples/scaling_tests/haystack/fruit_prover/base/RESULT
===================================================================
--- examples/scaling_tests/haystack/fruit_prover/base/RESULT	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
+++ examples/scaling_tests/haystack/fruit_prover/base/RESULT	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
@@ -0,0 +1,28 @@
+ 
+===good============ mary.what2eat <- navel orange
+YAP query succeed
+prover success!!
+credentials needed :
+ pMary.what2eat  <- pRalphs.fruitprice(P:[..2.00]) 
+ pRalphs.fruitprice(0.50)  <- 'navel orange' 
+ 
+===good============ mary.what2eat <- kiwi
+YAP query succeed
+prover success!!
+credentials needed :
+ pMary.what2eat  <- pRalphs.fruitprice(P:[..2.00]) 
+ pRalphs.fruitprice(1.50)  <- 'kiwi' 
+ 
+===bad============ bob.what2eat <- navel orange
+YAP query failed
+prover failed!!
+ 
+===good============ ralphs.fruitprice(1.50) <- apple
+YAP query succeed
+prover success!!
+credentials needed :
+ pRalphs.fruitprice(1.50)  <- 'apple' 
+ 
+===bad============ ralphs.fruitprice(1.50) <- green apple
+YAP query failed
+prover failed!!
Index: examples/scaling_tests/haystack/fruit_prover/get_time
===================================================================
--- examples/scaling_tests/haystack/fruit_prover/get_time	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
+++ examples/scaling_tests/haystack/fruit_prover/get_time	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+wc -l fruit_*/creds_dump
+grep user fruit_*/fruit.time
Index: examples/scaling_tests/haystack/fruit_prover/run_clean
===================================================================
--- examples/scaling_tests/haystack/fruit_prover/run_clean	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
+++ examples/scaling_tests/haystack/fruit_prover/run_clean	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+rm -rf fruit_*
Index: examples/scaling_tests/haystack/fruit_prover/run_one
===================================================================
--- examples/scaling_tests/haystack/fruit_prover/run_one	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
+++ examples/scaling_tests/haystack/fruit_prover/run_one	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
@@ -0,0 +1,22 @@
+#!/bin/sh 
+
+
+noise=$1
+
+rm -rf fruit_$noise
+mkdir fruit_$noise
+sed "s/#VAL#/$noise/" base/README > fruit_$noise/README
+cp base/RESULT fruit_$noise/fruit.save
+cp base/QUERY fruit_$noise/run_query
+cd fruit_$noise
+chmod +x README run_query
+./README
+time env ABAC_CN=1 ./run_query 1>fruit.tmp 2> fruit.time
+result=`diff fruit.tmp fruit.save 2>/dev/null`
+if [ "$result" = "" ]; then
+   echo "   PASSED"
+else   
+   echo "   ERROR"
+fi
+
+
Index: examples/scaling_tests/haystack/fruit_prover/run_test
===================================================================
--- examples/scaling_tests/haystack/fruit_prover/run_test	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
+++ examples/scaling_tests/haystack/fruit_prover/run_test	(revision 373bf68f62f13aadf7c0872bcb63f63a67777f99)
@@ -0,0 +1,55 @@
+#!/bin/sh 
+
+run_clean
+
+echo '---running haystack fruit_prover 0 scaling'
+run_one 0  1> log 2>/dev/null
+result=`grep PASSED log 2>/dev/null`
+if [ "$result" = "" ]; then
+   echo "   ERROR"
+else   
+   echo "   PASSED"
+fi
+rm -rf log
+
+
+echo '---running haystack fruit_prover 10 scaling'
+run_one 10  1> log 2>/dev/null
+result=`grep PASSED log 2>/dev/null`
+if [ "$result" = "" ]; then
+   echo "   ERROR"
+else   
+   echo "   PASSED"
+fi
+rm -rf log
+
+echo '---running haystack fruit_prover 20 scaling'
+run_one 20  1> log 2>/dev/null
+result=`grep PASSED log 2>/dev/null`
+if [ "$result" = "" ]; then
+   echo "   ERROR"
+else   
+   echo "   PASSED"
+fi
+rm -rf log
+
+echo '---running haystack fruit_prover 30 scaling'
+run_one 30  1> log 2>/dev/null
+result=`grep PASSED log 2>/dev/null`
+if [ "$result" = "" ]; then
+   echo "   ERROR"
+else   
+   echo "   PASSED"
+fi
+rm -rf log
+
+echo '---running haystack fruit_prover 200 scaling'
+run_one 200  1> log 2>/dev/null
+result=`grep PASSED log 2>/dev/null`
+if [ "$result" = "" ]; then
+   echo "   ERROR"
+else   
+   echo "   PASSED"
+fi
+rm -rf log
+
