gives(ovid,money,irs).
gives(ovid,book,grep).
gives(ovid,book,kudra).
####
?- gives(ovid,book,kudra).
##
##
?- gives(ovid,book,irs).
##
##
?- give(ovid,book,Who).
Who=grep
Who=kudra
##
##
{
'gives' => {
'Ovid' => {
'money' => {
'IRS' => undef
},
'book' => {
'grep' => undef,
'kudra' => undef
}
}
'kudra' => {
'book' => {
'ovid'=> undef
}
}
}
};
##
##
my @recipients = keys %{$facts{gives}{Ovid}{book}};
##
##
if ( exists $facts{gives}{Ovid}{book}{merlyn} ) { ... }
##
##
?- gives(Who,book,_);
Who=ovid
Who=kudra
yes
##
##
my @givers;
foreach my $person ( keys %{$facts{gives}} ) {
push @givers => $person if exists $facts{ gives }{ $person }{ book };
}
##
##
gives(ovid,book(learning_perl), merlyn).
##
##
?- gives(ovid, book(Title), merlyn).
Title=learning_perl
##
##
gives(kudra,book(learning_perl),merlyn).
##
##
location( kitchen_drawer, [ knife, fork, kitten ] ).
##
##
positive(Number) :-
Number > 0.