| 1 | package Logic::Relational::Goal::Identical; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 30 | ▶ | use v5.38; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | ## no critic (Subroutines::ProhibitExcessComplexity) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 30 | ▶ | use experimental 'signatures'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 30 | ▶ | use parent 'Logic::Relational::Goal'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 30 | ▶ | use builtin 'blessed'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 30 | ▶ | no warnings 'experimental::builtin'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | Logic::Relational::Goal::Identical - Evaluates strict term identity without variable binding. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 6 | ▶ | sub new ( $class, $left, $right ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 6 | return bless { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | left => $left, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | right => $right, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | }, $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub left ($self) { return $self->{left}; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
left: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub right ($self) { return $self->{right}; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
right: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 5 | ▶ | sub _are_identical ( $t1, $t2 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_are_identical: called CC=41 SCAR=63.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 5 | ▶ | return 1 if !defined($t1) && !defined($t2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $t1 or defined $t2
MC/DC0%0/2
defined $t1 or defined $t2
defined $t1
defined $t2
Truth table33%1/3
A or B
A= defined $t1B= defined $t2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 5 | ▶ | return 0 if !defined($t1) || !defined($t2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $t1 and defined $t2
MC/DC0%0/2
defined $t1 and defined $t2
defined $t1
defined $t2
Truth table33%1/3
A and B
A= defined $t1B= defined $t2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | # Variables: compare ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 5 | ▶ | if ( blessed($t1) && $t1->isa('Logic::Relational::Variable') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($t1) and $t1->isa("Logic::Relational::Variable")
MC/DC50%1/2
builtin::blessed($t1) and $t1->isa("Logic::Relational::Variable")
builtin::blessed($t1)
$t1->isa("Logic::Relational::Variable")
Truth table66%2/3
A and B
A= builtin::blessed($t1)B= $t1->isa("Logic::Relational::Variable")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 3 | ▶ | return ( blessed($t2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
builtin::blessed($t2) and $t2->isa("Logic::Relational::Variable") and $t1->id eq $t2->id
builtin::blessed($t2) and $t2->isa("Logic::Relational::Variable")
MC/DC33%1/3
builtin::blessed($t2) and $t2->isa("Logic::Relational::Variable") and $t1->id eq $t2->id
builtin::blessed($t2)
$t2->isa("Logic::Relational::Variable")
$t1->id eq $t2->id
Truth table50%2/4
A and B and C
A= builtin::blessed($t2)B= $t2->isa("Logic::Relational::Variable")C= $t1->id eq $t2->id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | && $t2->isa('Logic::Relational::Variable') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | && $t1->id eq $t2->id ) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | ▶ | if ( blessed($t2) && $t2->isa('Logic::Relational::Variable') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($t2) and $t2->isa("Logic::Relational::Variable")
MC/DC0%0/2
builtin::blessed($t2) and $t2->isa("Logic::Relational::Variable")
builtin::blessed($t2)
$t2->isa("Logic::Relational::Variable")
Truth table33%1/3
A and B
A= builtin::blessed($t2)B= $t2->isa("Logic::Relational::Variable")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | # Atoms: compare name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 2 | ▶ | if ( blessed($t1) && $t1->isa('Logic::Relational::Atom') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($t1) and $t1->isa("Logic::Relational::Atom")
MC/DC0%0/2
builtin::blessed($t1) and $t1->isa("Logic::Relational::Atom")
builtin::blessed($t1)
$t1->isa("Logic::Relational::Atom")
Truth table33%1/3
A and B
A= builtin::blessed($t1)B= $t1->isa("Logic::Relational::Atom")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | return ( blessed($t2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
builtin::blessed($t2) and $t2->isa("Logic::Relational::Atom") and $t1->name eq $t2->name
builtin::blessed($t2) and $t2->isa("Logic::Relational::Atom")
MC/DC0%0/3
builtin::blessed($t2) and $t2->isa("Logic::Relational::Atom") and $t1->name eq $t2->name
builtin::blessed($t2)
$t2->isa("Logic::Relational::Atom")
$t1->name eq $t2->name
Truth table0%0/4
A and B and C
A= builtin::blessed($t2)B= $t2->isa("Logic::Relational::Atom")C= $t1->name eq $t2->name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | && $t2->isa('Logic::Relational::Atom') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | && $t1->name eq $t2->name ) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 2 | ▶ | if ( blessed($t2) && $t2->isa('Logic::Relational::Atom') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($t2) and $t2->isa("Logic::Relational::Atom")
MC/DC0%0/2
builtin::blessed($t2) and $t2->isa("Logic::Relational::Atom")
builtin::blessed($t2)
$t2->isa("Logic::Relational::Atom")
Truth table33%1/3
A and B
A= builtin::blessed($t2)B= $t2->isa("Logic::Relational::Atom")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | # Terms: compare functor and args | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 2 | ▶ | if ( blessed($t1) && $t1->isa('Logic::Relational::Term') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($t1) and $t1->isa("Logic::Relational::Term")
MC/DC0%0/2
builtin::blessed($t1) and $t1->isa("Logic::Relational::Term")
builtin::blessed($t1)
$t1->isa("Logic::Relational::Term")
Truth table33%1/3
A and B
A= builtin::blessed($t1)B= $t1->isa("Logic::Relational::Term")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | unless blessed($t2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | && $t2->isa('Logic::Relational::Term') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | && $t1->functor eq $t2->functor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | && @{ $t1->args } == @{ $t2->args }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
builtin::blessed($t2) and $t2->isa("Logic::Relational::Term") and $t1->functor eq $t2->functor and @{$t1->args;} == @{$t2->args;}
builtin::blessed($t2) and $t2->isa("Logic::Relational::Term") and $t1->functor eq $t2->functor
builtin::blessed($t2) and $t2->isa("Logic::Relational::Term")
MC/DC0%0/4
builtin::blessed($t2) and $t2->isa("Logic::Relational::Term") and $t1->functor eq $t2->functor and @{$t1->args;} == @{$t2->args;}
builtin::blessed($t2)
$t2->isa("Logic::Relational::Term")
$t1->functor eq $t2->functor
@{$t1->args;} == @{$t2->args;}
Truth table0%0/5
A and B and C and D
A= builtin::blessed($t2)B= $t2->isa("Logic::Relational::Term")C= $t1->functor eq $t2->functorD= @{$t1->args;} == @{$t2->args;}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | for my $i ( 0 .. $#{ $t1->args } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | unless _are_identical( $t1->args->[$i], $t2->args->[$i] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 2 | ▶ | if ( blessed($t2) && $t2->isa('Logic::Relational::Term') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($t2) and $t2->isa("Logic::Relational::Term")
MC/DC0%0/2
builtin::blessed($t2) and $t2->isa("Logic::Relational::Term")
builtin::blessed($t2)
$t2->isa("Logic::Relational::Term")
Truth table33%1/3
A and B
A= builtin::blessed($t2)B= $t2->isa("Logic::Relational::Term")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | # Arrays | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 2 | ▶ | if ( ref($t1) eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | return 0 unless ref($t2) eq 'ARRAY' && @$t1 == @$t2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $t2 eq "ARRAY" and @$t1 == @$t2
MC/DC0%0/2
ref $t2 eq "ARRAY" and @$t1 == @$t2
ref $t2 eq "ARRAY"
@$t1 == @$t2
Truth table0%0/3
A and B
A= ref $t2 eq "ARRAY"B= @$t1 == @$t2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | for my $i ( 0 .. $#$t1 ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | return 0 unless _are_identical( $t1->[$i], $t2->[$i] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | # Hashes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | ▶ | if ( ref($t1) eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | return 0 unless ref($t2) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | my @k1 = sort keys %$t1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | my @k2 = sort keys %$t2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | return 0 unless @k1 == @k2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | for my $i ( 0 .. $#k1 ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | return 0 unless $k1[$i] eq $k2[$i]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | unless _are_identical( $t1->{ $k1[$i] }, $t2->{ $k2[$i] } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | # Plain scalar comparison | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 2 | ▶ | return $t1 eq $t2 ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 5 | ▶ | sub expand ( $self, %args ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
expand: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 5 | my $subst = $args{substitution}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 5 | my $remaining = $args{remaining}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 5 | my $state = $args{state}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 5 | my $walked_left = $subst->walk( $self->{left} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 5 | my $walked_right = $subst->walk( $self->{right} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 5 | ▶ | if ( _are_identical( $walked_left, $walked_right ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 2 | my $succ = $state->derive( goals => $remaining, ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 2 | ▶ | return $succ // (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$succ // ()
MC/DC0%0/2
$succ // ()
$succ
()
Truth table33%1/3
A // B
A= $succB= ()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 3 | return (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 2 | ▶ | sub freshen ( $self, $var_map ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
freshen: called CC=5 SCAR=20.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | my $fresh_left = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | blessed( $self->{left} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | && $self->{left}->can('freshen') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | ? $self->{left}->freshen($var_map) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 2 | ▶ | : $self->{left}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($self->{"left"}) and $self->{"left"}->can("freshen")
MC/DC0%0/2
builtin::blessed($self->{"left"}) and $self->{"left"}->can("freshen")
builtin::blessed($self->{"left"})
$self->{"left"}->can("freshen")
Truth table33%1/3
A and B
A= builtin::blessed($self->{"left"})B= $self->{"left"}->can("freshen")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | my $fresh_right = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | blessed( $self->{right} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | && $self->{right}->can('freshen') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | ? $self->{right}->freshen($var_map) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 2 | ▶ | : $self->{right}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($self->{"right"}) and $self->{"right"}->can("freshen")
MC/DC0%0/2
builtin::blessed($self->{"right"}) and $self->{"right"}->can("freshen")
builtin::blessed($self->{"right"})
$self->{"right"}->can("freshen")
Truth table33%1/3
A and B
A= builtin::blessed($self->{"right"})B= $self->{"right"}->can("freshen")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 2 | return ref($self)->new( $fresh_left, $fresh_right ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub is_ground ( $self, $subst ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_ground: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | return $self->term_is_ground( $self->{left}, $subst ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | && $self->term_is_ground( $self->{right}, $subst ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$self->term_is_ground($self->{'left'}, $subst) && $self->term_is_ground($self->{'right'}, $subst)
MC/DC0%0/2
$self->term_is_ground($self->{'left'}, $subst) && $self->term_is_ground($self->{'right'}, $subst)
$self->term_is_ground($self->{'left'}, $subst)
$self->term_is_ground($self->{'right'}, $subst)
Truth table0%0/3
A && B
A= $self->term_is_ground($self->{'left'}, $subst)B= $self->term_is_ground($self->{'right'}, $subst)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 30 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||