source: examples/python_tests/fruits_rt2/README @ f824a9e

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

1) add more doc to python_tests

  • Property mode set to 100755
File size: 1.7 KB
Line 
1#
2# This demonstrates assigning objects to object sets (osets) based on their
3# membership in other sets.  In this case there are 3 prinicpals. Mary and Bob
4# are encoding what fruits they are willing to eat in the oset Bob.what2eat and
5# Mary.what2eat.  Ralphs is defining the prices of the fruits it sells by
6# assigning them to osets parameterized by price.
7#
8# Credential 1 lays out Mary's policy - she will eat fruits that cost less that
9# or equal to 2.00.  Bob will eat fruits that cost between 1.00 and 5.00, as
10# laid out in Credential 2.  Strictly speaking Bob and Mary's rules apply to
11# prices assigned by Ralphs.  Credentials 3-6 are Ralph's price assignments:
12#
13# Fruit               Price      Credential
14# apple               1.50       3
15# kiwi                1.50       4
16# black rasberry      2.50       5
17# navel ornage        0.50       6
18#
19# The query.py file proves that Mary will eat a naval orange and a kiwi,
20# and that Bob will not eat a navel orange (too cheap).  It also proves a apple
21# is priced at 1.50 and that it cannot prove that a green apple is priced at
22# 1.50 (we don't know anything about green apples).
23
24# fruits_rt2
25
26# Credential 1
27# [keyid:mary].oset:what2eat
28#      <- [keyid:ralphs].oset:fruitprice([float:?P:[..2.00]])
29
30# Credential 2
31# [keyid:bob].oset:what2eat
32#      <- [keyid:ralphs].oset:fruitprice([float:?P:[1.00..5.00]])
33
34# Credential 3
35# [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'apple']
36
37# Credential 4
38# [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'kiwi']
39
40# Credential 5
41# [keyid:ralphs].oset:fruitprice([float:2.50]) <- [string:'black rasberry']
42
43# Credential 6
44# [keyid:ralphs].oset:fruitprice([float:0.50]) <- [string:'navel orange']
45
Note: See TracBrowser for help on using the repository browser.