Branch Coverage

lib/AI/Prolog/Term.pm
Criterion Covered Total %
branch 91 138 65.9


line true false branch
35 3 306 if defined $value
50 273 2191 unless @_
51 1651 540 if (2 == @_) { }
539 1 elsif (1 == @_) { }
52 1651 0 unless 'ARRAY' eq CORE::ref $_[1]
57 498 41 if not CORE::ref $arg and $arg =~ /^[[:digit:]]+$/
59 41 0 unless CORE::ref $arg
127 404 1497 defined $functor ? :
128 0 1901 unless defined $arity
181 0 0 if ($$self{'trace'})
194 0 324 if $self eq $term
195 324 0 if (not $$self{'bound'}) { }
223 50 0 if ($$self{'bound'} and not $$self{'deref'}) { }
238 811 0 if ($$self{'bound'}) { }
239 78 733 if $$self{'deref'}
249 0 1252 unless $$self{'bound'}
250 92 1160 if $$self{'deref'}
256 0 1140 unless $$self{'bound'}
257 67 1073 if $$self{'deref'}
266 0 0 if $$self{'varid'} == $var
272 0 0 if ($$self{'bound'}) { }
273 0 0 if $$self{'deref'}
275 0 0 if $$self{'args'}[$i]->occurs1($var)
289 0 0 $$self{'bound'} ? :
291 0 0 if (not $$self{'ref'}) { }
299 0 0 if (defined $$self{'args'}[0]) { }
310 0 0 $$self{'deref'} ? :
328 176 300 if ($$self{'bound'} and $$term{'bound'})
329 164 12 if ($self->functor eq $term->getfunctor and $self->arity == $term->getarity) { }
334 17 333 unless $$self{'args'}[$i]->unify($term->getarg($i), $stack)
343 58 242 if ($$self{'bound'})
346 0 58 if ($self->occurcheck)
347 0 0 if ($self->occurs($term->varid))
357 0 242 if $self->occurcheck and $term->occurs($self->varid)
370 745 438 if ($$self{'bound'})
371 437 308 if ($$self{'deref'}) { }
375 58 250 if (0 == $$self{'arity'}) { }
392 272 166 unless ($$term_aref[$$self{'varid'}])
409 26 327 if (defined $$self{'varname'})
418 349 4 if ($$self{'bound'})
421 140 209 if $$self{'deref'}
422 8 201 if 'null' eq $functor and not $arity
423 46 155 if ('cons' eq $functor and 2 == $arity) { }
428 1 85 if ($$term{'varname'}) { }
437 0 46 unless 'null' eq $term->getfunctor and not $term->getarity
446 15 140 if ($self->arity)
451 15 0 if (@args)
477 359 21 if ($$self{'bound'})
481 113 246 if $$self{'deref'}
482 4 0 if 'null' eq $functor and not $arity and $prettyprint
484 29 213 if ('cons' eq $functor and 2 == $arity and $prettyprint) { }
494 29 0 'null' eq $term->getfunctor && !$term->getarity ? :
501 61 152 if ($self->arity)
503 61 0 if ($self->arity)
508 3 125 $string =~ /\s/ && !$_->arity ? :
545 0 0 if ($$self{'bound'}) { }
546 0 0 if ($$self{'deref'}) { }
0 0 elsif (defined $$self{'arity'} and 0 == $$self{'arity'}) { }
561 0 0 unless ($term)
576 1 45 unless ($$self{'bound'})
580 24 21 if $$self{'deref'}
583 0 21 if ('rnd' eq $functor and 1 == $arity)
587 0 21 if ($arity < 2)
594 4 17 if 'plus' eq $functor
595 6 11 if 'minus' eq $functor
596 6 5 if 'mult' eq $functor
597 1 4 if 'div' eq $functor
598 1 3 if 'mod' eq $functor
599 3 0 if 'pow' eq $functor