Ejemplo n.º 1
0
<?php

require '../util.php';
require '../solver.php';
$domain = new KnowledgeDomain();
$domain->values['key']->push('value');
$domain->values['key']->push('nonvalue');
$subclause = new WhenAnyCondition();
$subclause->addCondition(new FactCondition('key', 'value'));
$clause = new WhenAllCondition();
$clause->addCondition($subclause);
$expect = new FactCondition('key', 'value');
assert('simplify($clause->negate($domain)->negate($domain)) == $expect');
Ejemplo n.º 2
0
<?php

require '../util.php';
require '../solver.php';
$domain = new KnowledgeDomain();
$domain->values['stoplicht']->push('rood');
$domain->values['stoplicht']->push('geel');
$domain->values['stoplicht']->push('groen');
$condition = new WhenAllCondition();
$condition->addCondition(new FactCondition('stoplicht', 'rood'));
$expected = new WhenAnyCondition();
$expected->addCondition(new FactCondition('stoplicht', 'geel'));
$expected->addCondition(new FactCondition('stoplicht', 'groen'));
assert('simplify($condition->negate($domain)) == $expected');