1 | The four Ws of partial proof |
---|
2 | |
---|
3 | libabac, by default, would attempt to extract a partial proof |
---|
4 | if the initial fact query can not be proven. If the initial fact |
---|
5 | query is found to be true, no partial proof will be attempted. |
---|
6 | |
---|
7 | A fact query, "Can Coyote buy red rockets from Acme ?", is |
---|
8 | equivalent to attribute query fact, |
---|
9 | |
---|
10 | "Acme.buy_rocket(red) <-?- Coyote". |
---|
11 | |
---|
12 | When it is presented to YAP prolog db by libabac, it is translated |
---|
13 | into "isMember(pAcme,buy_rocket,red):-pCoyote" for assertion. |
---|
14 | |
---|
15 | If the fact query can not be proven, libabac iterates through a |
---|
16 | sequence of actions in an attempt to discover partial proof |
---|
17 | related to the initial fact query. |
---|
18 | |
---|
19 | We can break down the fact query into a general form, |
---|
20 | |
---|
21 | whom.what(whatwith) <-?- who |
---|
22 | |
---|
23 | where 'whom' is the issuer principal, 'who' is the principal, |
---|
24 | 'what' is the role attribute and 'whatwith' is the parameter of |
---|
25 | the attribute. |
---|
26 | |
---|
27 | In the example fact query, 'whom' is Acme, 'who' is Coyote, |
---|
28 | 'what' is buy_rocket and red is assigned to 'whatwith'. |
---|
29 | |
---|
30 | In case, where such a fact can not be proven, one or more W |
---|
31 | terms are allowed to be uninstantiated and see what can be |
---|
32 | proven. |
---|
33 | |
---|
34 | Using the above example, the sequence libabac used to extract |
---|
35 | partial proof is as follows, |
---|
36 | |
---|
37 | case 1: acme.buy_rocket(red) <-?- coyote |
---|
38 | (Can Coyote buy red rockets from Acme?) |
---|
39 | If no, |
---|
40 | case 2: acme.What(Whatwith) <-?- coyote |
---|
41 | (What with Whatwith can Coyote buy from Acme?) |
---|
42 | If no, |
---|
43 | case 2p: acme.What() <-?- coyote |
---|
44 | (What can Coyote buy from Acme?) |
---|
45 | If no, |
---|
46 | case 3: acme.buy_rockets(red) <-?- Who |
---|
47 | (Who can buy red rockets from Acme?) |
---|
48 | If no, |
---|
49 | case 4: Whom.buy_rockets(red) <-?- coyote |
---|
50 | (From Whom can Coyote buy red rockets from?) |
---|
51 | If no, |
---|
52 | case 5: Whom.What(Whatwith) <-?- coyote |
---|
53 | (What with Whatwith can Coyote do from Whom?) |
---|
54 | |
---|
55 | 'whatwith' is in tandem with 'what', if there is no 'whatwith' |
---|
56 | term, then case 2p is skipped. |
---|
57 | |
---|
58 | Multiple partial proofs can be extracted using next_proof() api |
---|
59 | call just like for fact proofs. It is possible to force libabac to |
---|
60 | iterate through all the partial proof query cases listed above and |
---|
61 | collect all the possible partial proofs. It is likely that there |
---|
62 | will be duplication of proofs. No filtering will be done from libabac |
---|
63 | side since each individual partial proof query is considered to be |
---|
64 | independent from each other. |
---|
65 | |
---|
66 | Note, the return code of abac_context_query() is such that success |
---|
67 | is only returned if the fact query is true. Even when there is a |
---|
68 | returning partial proof, the return code will be false. |
---|
69 | |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | |
---|
74 | |
---|
75 | |
---|