File Coverage

lib/AI/Prolog/ChoicePoint.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 0 4 0.0
total 24 28 85.7


line stmt bran cond sub pod time code
1             package AI::Prolog::ChoicePoint;
2             $REVISION = '$Id: ChoicePoint.pm,v 1.5 2005/02/20 18:27:55 ovid Exp $';
3              
4             $VERSION = '0.02';
5 14     14   30369 use strict;
  14         30  
  14         485  
6 14     14   74 use warnings;
  14         26  
  14         464  
7 14     14   1310 use Hash::Util 'lock_keys';
  14         2761  
  14         194  
8              
9             sub new {
10 38     38 0 990 my ( $class, $goal, $clause ) = @_;
11 38         184 my $self = bless {
12             goal => $goal,
13             clause => $clause,
14             } => $class;
15 38         157 lock_keys %$self;
16 38         389 return $self;
17             }
18              
19 1     1 0 5 sub goal { $_[0]->{goal} }
20 2     2 0 11 sub clause { $_[0]->{clause} }
21              
22             sub to_string {
23 1     1 0 2 my $self = shift;
24 1         3 return " ||" . $self->clause->to_string . "|| ";
25             }
26              
27             1;
28              
29             __END__