Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/example3.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2003-10-07 10:55
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();


?>