Location: PHPKode > scripts > First Order Logic Prop > first-order-logic-prop/examples/example3.php
<?php


require '../FirstOrderLogicProp.inc.php';


class MyLogic extends FirstOrderLogicProp
{

    function MyLogic ()
    {
        parent::FirstOrderLogicProp();
    }

    function write ()
    {
        $cun = parent::isConjunctiveForm() ? 'YES' : 'no';
        $dis = parent::isDisjunctiveForm() ? 'YES' : 'no';
        echo "Formula: ";
        parent::write(FALSE);
        echo "\nis disjunctive ? $dis\n";
        echo "is cunjunctive ? $cun\n";
    }

}



$logic = &new MyLogic;

$formula = '! ( A -> B) & (A <-> B)';

$logic->parse($formula);
$logic->write();

echo "\nExpanded:\n";
$logic->expand();
$logic->writeLn();

echo "\nCleaned:\n";
$logic->clean();
$logic->writeLn();


?>
Return current item: First Order Logic Prop