Math::Logic::Predicate 0.03 review
Download
|
|
Math::Logic::Predicate is a Perl module to manage and query a predicate assertion database.
SYNOPSIS
use Math::Logic::Predicate;
$db = new Math::Logic::Predicate;
# Enter some predicates into the database
$db->add(retract( 'smart(_)' );
# Make a query
$query = $db->parse( 'human(H) & name(H, X) ?' );
$iter = $db->match($query, $iter);
# Get the results
$name = $db->get($iter, 'X');
# Store it in a rule
$db->add( 'human_name(H, N) := human(H) & name(H, N).' );
# Use it in a query
$iter = $db->match( 'human_name(lister, N) ?' );
# Save it to a file
use Storable;
store($db->rules, 'red_dwarf');
Requirements:
Perl
Math::Logic::Predicate 0.03 keywords