# File: demo/index.php

File: demo/index.php Example script text/plain The basic demo: showing the values table, normal forms, and can prove the given formula First Order Logic Prop Manipulate, analyze, and prove logic propositions By naholyr 19 years ago 3,418 bytes

## Contents

 ``` ';         echo '
'.htmlentities(\$var).''.htmlentities(\$formula).'
'.htmlentities(\$v['values'][\$var]).''.\$v['result'].'
';         foreach (\$vars as \$var) echo '';         echo '';         foreach (\$vals as \$v) {             echo '';             foreach (\$vars as \$var) echo '';             echo '';         }         echo '';     } } function check ( \$p ) {     echo 'checking '.htmlentities(\$p->toString()).'...
';     \$p->check();     if (\$p->theorem) {         echo 'This is a theorem !';     }     else {         echo 'This is not a theorem. Here is a counterexample:
';         echo 'If you affect ';         foreach (\$p->counterexample as \$aff) {             \$var = \$aff[0];             \$val = \$aff[1]->toString();             echo \$val.' to "'.\$var.'", ';         }         echo 'then the proposition becomes false.';     } } \$default = '(a c) & (b -> c)'; \$formula = isset(\$_POST['formula']) ? \$_POST['formula'] : \$default; \$p = new FOLP_HTML;//(\$formula); \$p->addSyntaxFile('syntax.litteral'); \$p->parse(\$formula) or \$formula = \$default; \$p->printValuesTable(); if (isset(\$_POST['cunj'])) {     \$q = &\$p->clone();     \$q->conjunctiveForm();     echo 'Forme conjonctive: '.htmlentities(\$q->toString()).'
';     \$q->destroy();     unset(\$q); } if (isset(\$_POST['disj'])) {     \$q = &\$p->clone();     \$q->disjunctiveForm();     echo 'Forme disjonctive: '.htmlentities(\$q->toString()).'
';     \$q->destroy();     unset(\$q); } if (isset(\$_POST['check'])) check(\$p); \$p->destroy(); unset(\$p); ?>

Afficher la forme conjonctive*
Afficher la forme disjonctive*
Exécuter le prouveur sur la proposition*
* le temps de calcul peut être important
* ATTENTION le temps de calcul peut être TRES important

Syntaxes:

• TRUE: "TRUE" ou "1"
• FALSE: "FALSE" ou "0"
• NOT: "NOT" ou "!"
• AND: "AND" ou "&"
• NAND: "NAND" ou "!&"
• OR: "OR" ou "|"
• NOR: "NOR" ou "!|"
• XOR: "XOR" ou "<!>"
• IMPLIES: "IMPLIES" ou "->"
• NOT_IMPLIES: "NOT_IMPLIES" ou "-!>"
• IMPLIED: "IMPLIED_BY" ou "<-"
• NOT_IMPLIED: "NOT_IMPLIED_BY" ou "<!-"
• IFF: "IF_ONLY_IF" ou "<->"
```
For more information send a message to `info at phpclasses dot org`.