Examples

Here is presented an example of use of PPL:

$>>>$ import PPL
$>>>$ s1 = 'a $<=>$ (b|c)'
$>>>$ s1
'a $<=>$ (b|c)'
$>>>$ s2 = PPL.toCNF(s1)
$>>>$ s2
'((~b $\mid$ a) & (~c $\mid$ a) & (b $\mid$ c $\mid$ ~a))'
$>>>$ PPL.p(s1, 0.5)
$>>>$ s3 = 'd $\mid$ (e & f) $\mid$ g'
$>>>$ s3
'd $\mid$ (e & f) $\mid$ g'
$>>>$ s4 = PPL.toCNF(s3)
$>>>$ s4
'((e $\mid$ d $\mid$ g) & (f $\mid$ d $\mid$ g))'
$>>>$ PPL.p(s3, 0.3, 0.8)
$>>>$ PPL.checkCoherence()
Coherent!

In the figure 1 is presented a similar example executed with IDLE:

Figure 1: Example of using PPL in IDLE
\includegraphics[scale=0.4]{exemplo.eps}



Andre da Costa Teves 2007-08-11