| 1 | package Logic::Relational::Goal::All; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 31 | ▶ | use v5.38; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 31 | ▶ | use experimental 'signatures'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 31 | ▶ | use parent 'Logic::Relational::Goal'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | =head1 NAME | ||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | Logic::Relational::Goal::All - Conjunction of goals (AND). | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | =cut | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 213 | ▶ | sub new ( $class, $goals ) { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 14 | 213 | return bless { goals => $goals }, $class; | |||||||||||||||||||
| 15 | } | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 109 | ▶ | sub goals ($self) { return $self->{goals}; } | ||||||||||||||||||
|
Subroutine
goals: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 97 | ▶ | sub expand ( $self, %args ) { | ||||||||||||||||||
|
Subroutine
expand: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||
| 20 | 97 | my $state = $args{state}; | |||||||||||||||||||
| 21 | 97 | my $remaining = $args{remaining}; | |||||||||||||||||||
| 22 | 97 | my $succ = $state->derive( goals => [ @{ $self->{goals} }, @$remaining ], ); | |||||||||||||||||||
| 23 | 97 | ▶ | return $succ // (); | ||||||||||||||||||
|
Condition33%1/3
$succ // ()
MC/DC0%0/2
$succ // ()
$succ
()
Truth table33%1/3
A // B
A= $succB= ()
| |||||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 91 | ▶ | sub freshen ( $self, $var_map ) { | ||||||||||||||||||
|
Subroutine
freshen: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 27 | 91 | my @fresh_goals = map { $_->freshen($var_map) } @{ $self->{goals} }; | |||||||||||||||||||
| 28 | 91 | return ref($self)->new( \@fresh_goals ); | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 0 | ▶ | sub is_ground ( $self, $subst ) { | ||||||||||||||||||
|
Subroutine
is_ground: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 32 | 0 | for my $goal ( @{ $self->{goals} } ) { | |||||||||||||||||||
| 33 | 0 | ▶ | return 0 unless $goal->is_ground($subst); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | 0 | return 1; | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 31 | 1; | |||||||||||||||||||