source: examples/python_tests/fruits_rt2/README @ 549656e

mei_rt2mei_rt2_fix_1
Last change on this file since 549656e 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
RevLine 
[7211a95]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
[f824a9e]10# laid out in Credential 2.  Strictly speaking Bob and Mary's rules apply to
[7211a95]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
[f824a9e]16# black rasberry      2.50       5
[7211a95]17# navel ornage        0.50       6
18#
[f824a9e]19# The query.py file proves that Mary will eat a naval orange and a kiwi,
[7211a95]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
[f824a9e]24# fruits_rt2
[7211a95]25
[f824a9e]26# Credential 1
[7211a95]27# [keyid:mary].oset:what2eat
28#      <- [keyid:ralphs].oset:fruitprice([float:?P:[..2.00]])
29
[f824a9e]30# Credential 2
[7211a95]31# [keyid:bob].oset:what2eat
32#      <- [keyid:ralphs].oset:fruitprice([float:?P:[1.00..5.00]])
33
34# Credential 3
[f824a9e]35# [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'apple']
[7211a95]36
37# Credential 4
[f824a9e]38# [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'kiwi']
[7211a95]39
40# Credential 5
[f824a9e]41# [keyid:ralphs].oset:fruitprice([float:2.50]) <- [string:'black rasberry']
[7211a95]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.