Różnice
Różnice między wybraną wersją a wersją aktualną.
Both sides previous revision
Poprzednia wersja
Nowa wersja
|
Poprzednia wersja
|
pl:miw:miw08_xtt_rif:rif_minicases [2008/04/02 21:33] miw |
pl:miw:miw08_xtt_rif:rif_minicases [2008/04/26 15:33] miw |
====== RIF i Minicases ====== | |
===== restrictive behavior ===== | |
Reguła: ''if X > 2 then Y = X'' | |
| |
Podobną strukturę przedstawiłem [[pl:miw:miw08_xtt_rif#przemyslenia_dotyczace_regul_zawierajacych_przypisanie|ostatnio]]. | |
| |
===== restrictive behavior and multiple values ===== | |
There is a student with several grades indicated by attribute grades. A grade could be: 2,3,4,5 I need a count how many 2 grades he has (nrfail), how many grades in total (nrgrades), and what is the mean (grmean). | |
| |
<code xml> | |
<Ruleset> | |
<rule> | |
<Forall> | |
<declare><Var>grade</Var></declare> | |
<formula> | |
<Implies> | |
<if> | |
<formula> | |
<Equal> | |
<arg><Var>grade</Var></arg> | |
<arg><Const type="xsd:decimal">2</Const></arg> | |
</Equal> | |
</formula> | |
</if> | |
<then> | |
<Uniterm> | |
<op><Const type="rif:local">nrfail</Const></op> | |
<arg> | |
<Uniterm> | |
<op><Const type="rif:local">count</Const></op> | |
<arg><Var>grade</Var></arg> | |
</Uniterm> | |
</arg> | |
</Uniterm> | |
</then> | |
</Implies> | |
</formula> | |
</Forall> | |
</rule> | |
<rule> | |
<Forall> | |
<declare><Var>grade</Var></declare> | |
<formula> | |
<Implies> | |
<if> | |
<formula> | |
<Uniterm> | |
<op><Const type="rif:local">op:not-equal</Const></op> | |
<arg><Var>grade</Var></arg> | |
<arg><Const type="xsd:decimal">2</Const></arg> | |
</Uniterm> | |
</formula> | |
</if> | |
<then> | |
!!! | |
</then> | |
</Implies> | |
</formula> | |
</Forall> | |
</rule> | |
</Ruleset> | |
</code> | |