Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 8a80864b07c5f16e9ba9be320c149cfa > files > 17

teyjus-1.0_b31-15mdk.i586.rpm

/*
 * A testing harness for code that analyzes the structure of formula
 * representation; the particular analysis involves recognizing 
 * goals and program clauses in Horn clause logic
 */

module  hcsyntax_examples.

accumulate  hc_syntax, refl_syntax.

/* some sample formulas */
formula  1  (some x \ ((path a x) and (path x b))).
formula  2  (some x \ ((path a x) imp (path x b))).
formula  3  ((path a b) and (path b a)).
formula  4  ((path a b) imp (path b a)).

formula  5  ((path a b) imp (adj a b)).
formula  6  (all x\ all y\ ((path x y) imp (adj x y))).
formula  7  (all x\ all y\ (((path x y) imp (adj x y)) imp (adj x y))).

/* testing whether or not one of the formulas above is a goal or a clause */
test_goal N :- formula N F, goal F. 
test_defcl N :- formula N F, def_clause F.