Commit 6be7d8eed1a8da582ce0eed8963736c883e35d15
1 parent
75457690
Exists in
master
Organised text
Showing
2 changed files
with
161 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,143 @@ | @@ -0,0 +1,143 @@ | ||
1 | +# Probabilistic Answer Set Programming | ||
2 | + | ||
3 | +## Non-stratified programs | ||
4 | + | ||
5 | +> Minimal example of **non-stratified program**. | ||
6 | + | ||
7 | +The following annotated LP, with clauses $c_1, c_2, c_3$ respectively, is non-stratified (because has a cycle with negated arcs) but no head is disjunctive: | ||
8 | +```prolog | ||
9 | +0.3::a. % c1 | ||
10 | +s :- not w, not a. % c2 | ||
11 | +w :- not s. % c3 | ||
12 | +``` | ||
13 | + | ||
14 | +This program has three stable models: | ||
15 | +$$ | ||
16 | +\begin{aligned} | ||
17 | +m_1 &= \set{ a, w } \cr | ||
18 | +m_2 &= \set{ \neg a, s } \cr | ||
19 | +m_3 &= \set{ \neg a, w } | ||
20 | +\end{aligned} | ||
21 | +$$ | ||
22 | + | ||
23 | +The probabilistic clause `0.3::a.` defines a **total choice** | ||
24 | +$$ | ||
25 | +\Theta = \set{ | ||
26 | + \theta_1 = \set{ a }, | ||
27 | + \theta_2 = \set{ \neg a } | ||
28 | +} | ||
29 | +$$ | ||
30 | +such that | ||
31 | +$$ | ||
32 | +\begin{aligned} | ||
33 | +P(\Theta = \set{ a }) &= 0.3\cr | ||
34 | +P(\Theta = \set{ \neg a }) &= 0.7 \cr | ||
35 | +\end{aligned} | ||
36 | +$$ | ||
37 | + | ||
38 | +> While it is natural to extend $P( m_1 ) = 0.3$ from $P(\theta_1) = 0.3$ there is no clear way to assign $P(m_2), P(m_3)$ since both models result from the total choice $\theta_2$. | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | +Under the **CWA**, $\sim\!\!q \models \neg q$, so $c_2, c_3$ induce probabilities: | ||
43 | + | ||
44 | +$$ | ||
45 | +\begin{aligned} | ||
46 | +p_a &= P(a | \Theta) \cr | ||
47 | +p_s &= P(s | \Theta) &= (1 - p_w)(1 - p_a) \cr | ||
48 | +p_w &= P(w | \Theta) &= (1 - p_w) | ||
49 | +\end{aligned} | ||
50 | +$$ | ||
51 | +from which results | ||
52 | +$$ | ||
53 | +\begin{equation} | ||
54 | +p_s = p_s(1 - p_a). | ||
55 | +\end{equation} | ||
56 | +$$ | ||
57 | + | ||
58 | +So, if $\Theta = \theta_1 = \set{ a }$ (one stable model): | ||
59 | + | ||
60 | +- We have $p_a = P(a | \Theta = \set{ a }) = 1$. | ||
61 | +- Equation (1) becomes $p_s = 0$. | ||
62 | +- From $p_w = 1 - p_s$ we get $P(w | \Theta) = 1$. | ||
63 | + | ||
64 | +and if $\Theta = \theta_2 = \set{ \neg a }$ (two stable models): | ||
65 | + | ||
66 | +- We have $p_a = P(a | \Theta = \set{ \neg a }) = 0$. | ||
67 | +- Equation (1) becomes $p_s = p_s$; Since we know nothing about $p_s$, we let $p_s = \alpha \in \left[0, 1\right]$. | ||
68 | +- We still have the relation $p_w = 1 - p_s$ so $p_w = 1 - \alpha$. | ||
69 | + | ||
70 | +We can now define the **marginals** for $s, w$: | ||
71 | +$$ | ||
72 | +\begin{aligned} | ||
73 | +P(s) &=\sum_\theta P(s|\theta)P(\theta)= 0.7\alpha \cr | ||
74 | +P(w) &=\sum_\theta P(s|\theta)P(\theta)= 0.3 + 0.7(1 - \alpha) \cr | ||
75 | +\alpha &\in\left[ 0, 1 \right] | ||
76 | +\end{aligned} | ||
77 | +$$ | ||
78 | + | ||
79 | +> The parameter $\alpha$ not only **expresses insufficient information** to sharply define $p_s$ but also **relates** $p_s$ and $p_w$. | ||
80 | + | ||
81 | +## Disjunctive heads | ||
82 | + | ||
83 | +> Minimal example of **disjunctive heads** program. | ||
84 | + | ||
85 | +Consider this LP | ||
86 | + | ||
87 | +```prolog | ||
88 | +0.3::a. | ||
89 | +b ; c :- a. | ||
90 | +``` | ||
91 | + | ||
92 | +with three stable models: | ||
93 | +$$ | ||
94 | +\begin{aligned} | ||
95 | +m_1 &= \set{ \neg a } \cr | ||
96 | +m_2 &= \set{ a, b } \cr | ||
97 | +m_3 &= \set{ a, c } | ||
98 | +\end{aligned} | ||
99 | +$$ | ||
100 | + | ||
101 | +Again, $P(m_1) = 0.3$ is quite natural but there are no clear assignments for $P(m_2), P(m_3)$. | ||
102 | + | ||
103 | +The total choices here are | ||
104 | +$$ | ||
105 | +\Theta = \set{ | ||
106 | + \theta_1 = \set{ a } | ||
107 | + \theta_2 = \set{ \neg a } | ||
108 | +} | ||
109 | +$$ | ||
110 | +such that | ||
111 | +$$ | ||
112 | +\begin{aligned} | ||
113 | +P(\Theta = \set{ a }) &= 0.3\cr | ||
114 | +P(\Theta = \set{ \neg a }) &= 0.7 \cr | ||
115 | +\end{aligned} | ||
116 | +$$ | ||
117 | +and the LP induces | ||
118 | +$$ | ||
119 | +P(b \vee c | \Theta) = P(a | \Theta). | ||
120 | +$$ | ||
121 | + | ||
122 | +Since the disjunctive expands as | ||
123 | +$$ | ||
124 | +\begin{equation} | ||
125 | +P(b \vee c | \Theta) = P(b | \Theta) + P( c | \Theta) - P(b \wedge c | \Theta) | ||
126 | +\end{equation} | ||
127 | +$$ | ||
128 | +and we know that $P(b \vee c | \Theta) = P(a | \Theta)$ we need two independent parameters, for example | ||
129 | +$$ | ||
130 | +\begin{aligned} | ||
131 | +P(b | \Theta) &= \beta \cr | ||
132 | +P(c | \Theta) &= \gamma \cr | ||
133 | +\end{aligned} | ||
134 | +$$ | ||
135 | +where | ||
136 | +$$ | ||
137 | +\begin{aligned} | ||
138 | + \alpha & \in \left[0, 0.3\right] \cr | ||
139 | + \beta & \in \left[0, \alpha\right] | ||
140 | +\end{aligned} | ||
141 | +$$ | ||
142 | + | ||
143 | +This example also calls for reconsidering the CWA since it entails that **we should assume that $b$ and $c$ are conditionally independent given $a$.** | ||
0 | \ No newline at end of file | 144 | \ No newline at end of file |
@@ -0,0 +1,18 @@ | @@ -0,0 +1,18 @@ | ||
1 | +# Probabilistic ASP | ||
2 | + | ||
3 | +## Weighted Approach | ||
4 | + | ||
5 | +1. **Total Choices.** $N(C = x) = \prod_{a \in x} w_a \prod_{\neg a \in x} (1 - w_a)$. | ||
6 | +2. **Stable Models.** $N(S = x | C = c) = \alpha_{x,c}$, | ||
7 | + where the set of parameters $\alpha_{x,c}$ is such that: | ||
8 | + $$ | ||
9 | + \begin{cases} | ||
10 | + \alpha_{x,c} \geq 0, & \forall c, x\cr | ||
11 | + \alpha_{x,c} = 0, & \forall x \not\supseteq c \cr | ||
12 | + \sum_{x} \alpha_{x,c} = 1, & \forall c. | ||
13 | + \end{cases} | ||
14 | + $$ | ||
15 | +3. **Worlds.** $N(W = x)$ | ||
16 | + 1. If $x$ is a _total choice_: $ | ||
17 | + N(W = x) = \prod_{a \in x} w_a \prod_{\neg a \in x} (1 - w_a). | ||
18 | + $$ | ||
0 | \ No newline at end of file | 19 | \ No newline at end of file |