PHP Classes

File: examples/example3.php

Recommend this page to a friend!
  Classes of naholyr   First Order Logic Prop   examples/example3.php   Download  
File: examples/example3.php
Role: Example script
Content type: text/plain
Description: testing if propositions are in disjunctive/conjunctive forms
Class: First Order Logic Prop
Manipulate, analyze, and prove logic propositions
Author: By
Last change:
Date: 20 years ago
Size: 696 bytes
 

Contents

Class file image Download
<?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();


?>