# # This demonstrates assigning objects to object sets (osets) based on their # membership in other sets. In this case there are 3 prinicpals. Mary and Bob # are encoding what fruits they are willing to eat in the oset Bob.what2eat and # Mary.what2eat. Ralphs is defining the prices of the fruits it sells by # assigning them to osets parameterized by price. # # Credential 1 lays out Mary's policy - she will eat fruits that cost less that # or equal to 2.00. Bob will eat fruits that cost between 1.00 and 5.00, as # laid out in Credential 2. Strictly speaking Bob and Mary's rules apply to # prices assigned by Ralphs. Credentials 3-6 are Ralph's price assignments: # # Fruit Price Credential # apple 1.50 3 # kiwi 1.50 4 # black rasberry 2.50 5 # navel ornage 0.50 6 # # The query.py file proves that Mary will eat a naval orange and a kiwi, # and that Bob will not eat a navel orange (too cheap). It also proves a apple # is priced at 1.50 and that it cannot prove that a green apple is priced at # 1.50 (we don't know anything about green apples). # fruits_rt2 # Credential 1 # [keyid:mary].oset:what2eat # <- [keyid:ralphs].oset:fruitprice([float:?P:[..2.00]]) # Credential 2 # [keyid:bob].oset:what2eat # <- [keyid:ralphs].oset:fruitprice([float:?P:[1.00..5.00]]) # Credential 3 # [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'apple'] # Credential 4 # [keyid:ralphs].oset:fruitprice([float:1.50]) <- [string:'kiwi'] # Credential 5 # [keyid:ralphs].oset:fruitprice([float:2.50]) <- [string:'black rasberry'] # Credential 6 # [keyid:ralphs].oset:fruitprice([float:0.50]) <- [string:'navel orange']