source: examples/creddy_prover_tests/fruits_rt2/run_query @ 340bd01

mei_rt2mei_rt2_fix_1
Last change on this file since 340bd01 was 08b8da7, checked in by Mei <mei@…>, 12 years ago

1) rework examples directory with Makefile
2) update scaling with plotting scripts
3) add more doc in there

  • Property mode set to 100755
File size: 1.7 KB
Line 
1
2# fruits_rt2_typed
3
4pwd=`pwd`
5eloc=`which abac_prover_yap | sed 's/\/abac_prover_yap//'`
6if [ "$eloc" = "" ]; then
7  echo "ERROR: abac_prover_yap is not in the search path!!!"
8  exit 1
9fi
10keyloc=$pwd
11
12ralphs=`creddy --keyid --cert $keyloc/Ralphs_ID.pem`
13bob=`creddy --keyid --cert $keyloc/Bob_ID.pem`
14mary=`creddy --keyid --cert $keyloc/Mary_ID.pem`
15
16mary_what2eat="[keyid:$mary].oset:what2eat"
17bob_what2eat="[keyid:$bob].oset:what2eat"
18ralphs_apple="[keyid:$ralphs].oset:fruitprice([float:1.50])"
19
20## dump all credentials
21$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
22
23# [keyid:mary].oset:what2eat <-?- [string:'navel orange'] (yes)
24echo " "
25echo "===good============ mary.what2eat <- navel orange"
26$eloc/abac_prover_yap  --keystore $keyloc --oset "$mary_what2eat" --object "[string:'navel orange']"
27
28# [keyid:mary].oset:what2eat <-?- [string:'kiwi'] (yes)
29echo " "
30echo "===good============ mary.what2eat <- kiwi"
31$eloc/abac_prover_yap  --keystore $keyloc --oset "$mary_what2eat" --object "[string:'kiwi']"
32
33# [keyid:bob].oset:what2eat <-?- [string:'navel orange'] (no)
34echo " "
35echo "===bad============ bob.what2eat <- navel orange"
36$eloc/abac_prover_yap  --keystore $keyloc --oset "$bob_what2eat" --object "[string:'navel orange']"
37
38# [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'apple'] (yes)
39echo " "
40echo "===good============ ralphs.fruitprice(1.50) <- apple"
41$eloc/abac_prover_yap  --keystore $keyloc --oset "$ralphs_apple" --object "[string:'apple']"
42
43# [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'green apple'] (no)
44echo " "
45echo "===bad============ ralphs.fruitprice(1.50) <- green apple"
46$eloc/abac_prover_yap  --keystore $keyloc --oset "$ralphs_apple" --object "[string:'green apple']"
47
48
Note: See TracBrowser for help on using the repository browser.