fbf ::= <predicato>
| <negazione> | <cong> | <disg> | <implicazione>
| <universale> | <esistenziale>
predicato ::= <symbol that starts with a letter>
| '(' <simbolo> <termine>* ')'
negazione ::= '(' not <fbf> ')'
cong ::= '(' and <fbf> <fbf> ')'
disg ::= '(' or <fbf> <fbf> ')'
implicazione ::= '(' ==> <fbf> <fbf> ')'
universale ::= '(' forall <variabile> <fbf> ')'
esistenziale ::= '(' exist <variabile> <fbf> ')'
naturally you have to consider also well formed formulae which more complex:
cong' ::= '(' and <fbf>* ')'
disg' ::= '(' or <fbf>* ')'
termine ::= <costante> | <variabile> | <funzione>
costante ::= <numeri> | <symbol that starts with a letter>
variabile ::= <symbol that starts with ?>
funzione ::= '(' <simbolo> <termine>* ')'