xdi message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: link contract logic tree: $and, $or, $true, $false
- From: Drummond Reed <drummond.reed@xdi.org>
- To: OASIS - XDI TC <xdi@lists.oasis-open.org>
- Date: Thu, 28 Jul 2011 13:02:08 -0700
With regard to the rapidly evolving OpenXDI discussion of link contract policy expression, currently Mike has proposed a $if context (as a child of a $do context, which is the link contract root), which in turn contains a $condition context. The $condition context may then optionally contain $and and $or contexts, or directly contain condition expressions.
In thinking about this on my vacation (for at least in a few idle moments ;-), I worked out a simpler and more flexible way for this "logic tree" to be constructed. It still starts with the root policy expression root node of $if. But rather than a $condition node, we just have four possible child context nodes:
- $true for conditions that must evaluate to true to pass.
- $false for conditions that must evaluation to false to pass.
- $and for grouping conditions that must all pass together in order to pass.
- $or for grouping conditions that only one must pass in order to pass.
The beauty is that these can be used in any combination, to any depth, with any condition expressions, to form a policy expression. The logic rules are always the same.
In the following examples, I've used nesting to indicate XDI parent/child contexts, and parens to indicate condition expressions (which are just written in pseudocode, not actual XDI expressions).
1)
$if
$true
(age > "21")
2)
$if
$true
$and
(age > "21")
(driver's license)
3)
$if
$and
$true
$and
(age > "21")
(driver's license)
$false
(outstanding-ticket)
4)
$if
$and
$true
$and
(age > "21")
(driver's license)
$or
$false
(outstanding-ticket)
$true
(insurance-policy)
=Drummond
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]