Skip to content

Commit e0f20b7

Browse files
committed
docs: add rules example
1 parent 576bd98 commit e0f20b7

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

docs/examples/modeling-rules.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Modeling with Rules
2+
3+
## Rewriting Deontic Positions in Terms of Power
4+
5+
Let's imagine that we have a [duty](../reference/positions.md#deontic-frames) `d` for `john` to `#pay` another [agent](../reference/objects-and-events.md#agents) `paul`.
6+
7+
```
8+
duty {
9+
holder: john
10+
counterparty: paul
11+
action: #pay
12+
violation: timeout
13+
} as d
14+
```
15+
16+
Now we have obtained a deontic view on the payment. However, this only models part of the problem. We could introduce a [transformational rule](../reference/rules.md#transformational-rules) that refines the context when a payment [duty](../reference/positions.md#deontic-frames) is introduced.
17+
18+
```
19+
d -> {
20+
john.#pay => +power {
21+
holder: paul
22+
action: #declare_fulfillment { item: d }
23+
consequence: +d.fulfilled
24+
}
25+
timeout => +power {
26+
holder: paul
27+
action: #declare_violation { item: d }
28+
consequence: +d.violated
29+
}
30+
}
31+
```
32+
33+
Within this context, the [agent](../reference/objects-and-events.md#agents) `john` can perform the [action](../reference/objects-and-events.md#action-events) `#pay`, which allows the counterparty `paul` to `#declare_fulfillment` of the original [duty](../reference/positions.md#deontic-frames).
34+
35+
Moreover, we can provide further detail on the violation mechanism. In this case, we actively provide the counterparty with the [power](../reference/positions.md#power-frames) to `#declare_violation`.
36+
37+
This explicit model allows for better tracing of the activities performed by the [agents](../reference/objects-and-events.md#agents) and brings [power](../reference/positions.md#power-frames) at the forefront of the modeling strategy.
38+
39+
## Rewriting Knowledge in Terms of Power
40+
41+
Transformational rules can be seen not only as _epistemic_ [duties](../reference/positions.md#deontic-frames) of producing knowledge, but also as [powers](../reference/positions.md#power-frames).
42+
43+
For instance, we could model the epistemic knowledge that a `car` constitutes a `vehicle`.
44+
45+
```
46+
car -> vehicle
47+
```
48+
49+
However, thanks to [transformational rules](../reference/rules.md#transformational-rules) being able to create contexts, we can further refine the implications of some piece of knowledge.
50+
51+
For example, when modeling a Vehicle Licensing Agency system, we might want to express [duties](../reference/positions.md#deontic-frames) and [powers](../reference/positions.md#power-frames) related to the existence of vehicles.
52+
53+
```
54+
car -> {
55+
duty {
56+
holder: *
57+
action: +vehicle
58+
}
59+
power {
60+
holder: *
61+
action: #state { item: vehicle }
62+
consequence: +vehicle
63+
}
64+
}
65+
```
66+
67+
Here we express the _epistemic_ [duty](../reference/positions.md#deontic-frames) to activate the `vehicle` state, but also the [power](../reference/positions.md#power-frames) for a someone to actively `#state` the existence of a `vehicle`.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ nav:
7070
- Composite Objects: reference/composite-objects.md
7171
- Examples:
7272
- Library Regulation: examples/library.md
73+
- Modeling with Rules: examples/modeling-rules.md
7374
- Comparison with ODRL: examples/comparison-odrl.md

0 commit comments

Comments
 (0)