? dict ?X
SetValue 0.X {{ }}
? eq ?Y X
+BindValue 0.Y 0.X
? qact
SetValue 0.X {{ }}
-? eq Y {{ foo 1 }}
BindValue 0.Y 0.X
+? eq Y {{ foo 1 }}
+SetBoundValue 0.Y {{ foo 1 }}
+SetValue 0.X {{ foo 1 }}
? qact
SetValue 0.X {{ }}
+SetValue 0.X {{ foo 1 }}
BindValue 0.Y 0.X
? .
-{{ X {{ }} Y {{ }} }}
+{{ X {{ foo 1 }} Y {{ foo 1 }} }}
$ ?
? dict ?X {{ foo {{ bar 1 }} }}
SetValue 0.X {{ foo {{ bar 1 }} }}
? member_at X 'foo' ?Y
-? member_at Y 'bar' ?Z
BindValue 0.Y 0.X.foo
-? eq Z 2
+? member_at Y 'bar' ?Z
BindValue 0.Z 0.Y.bar
-? member_at Y 'baz' 4
+? eq Z 2
SetBoundValue 0.Z 2
SetBoundValue 0.Y.bar 2
SetValue 0.X.foo.bar 2
+? member_at Y 'baz' 4
+AddBoundValue 0.Y.baz 4
+AddValue 0.X.foo.baz 4
? qact
SetValue 0.X {{ foo {{ bar 1 }} }}
SetValue 0.X.foo.bar 2
-BindValue 0.Y 0.X.foo
BindValue 0.Z 0.Y.bar
+AddValue 0.X.foo.baz 4
+BindValue 0.Y 0.X.foo
? .
-{{ X {{ foo {{ bar 2 }} }} Y {{ bar 2 }} Z 2 }}
+{{ X {{ foo {{ bar 2 baz 4 }} }} Y {{ bar 2 baz 4 }} Z 2 }}
? eq OS 'debian'
? ...
{{ Name 'agaton' OS 'debian' }}
-{{ Name 'hatebox' OS 'rhel' }}
{{ Name 'sherlock' OS 'debian' }}
No next solution
? eq ?X {{ a 1 b 2 c 3 }}
SetValue 0.X {{ a 1 b 2 c 3 }}
? member_at X ?Y ?Z
+SetValue 0.Y 'a'
+BindValue 0.Z 0.X.a
? ...
-{{ X {{ a 1 b 2 c 3 }} Y unset Z unset }}
+{{ X {{ a 1 b 2 c 3 }} Y 'a' Z 1 }}
+{{ X {{ a 1 b 2 c 3 }} Y 'b' Z 2 }}
+{{ X {{ a 1 b 2 c 3 }} Y 'c' Z 3 }}
No next solution
$ qlist
eq ?X {{ a 1 b 2 c 3 }}
? eq ?X {{ a 1 b 2 c 3 }}
SetValue 0.X {{ a 1 b 2 c 3 }}
? member_at X ?Y ?Z
-? eq Z 2
SetValue 0.Y 'a'
BindValue 0.Z 0.X.a
+? eq Z 2
? ...
-{{ X {{ a 1 b 2 c 3 }} Y 'a' Z 1 }}
{{ X {{ a 1 b 2 c 3 }} Y 'b' Z 2 }}
-{{ X {{ a 1 b 2 c 3 }} Y 'c' Z 3 }}
No next solution
$ qlist
eq ?X {{ a 1 b 2 c 3 }}
return $self->but(resolved_propositions => $rps);
}
-sub resolve_head_dependent_on {
- my ($self, $depends) = @_;
+sub with_resolution {
+ my ($self, $prop, $depends) = @_;
my ($first, @rest) = @{$self->outstanding_propositions};
$self->but(
resolved_propositions => $self->resolved_propositions
->with_resolution_for(
- $first,
+ $prop,
$depends,
),
outstanding_propositions => \@rest,
has alternatives => (is => 'ro', isa => AlternativeList, required => 1);
sub next_proposition {
- my ($self) = @_;
+ my ($self, $hyp) = @_;
+ $hyp ||= $self->current_hypothesis;
$self->propositions->members->[
- $self->current_hypothesis->resolved_propositions->resolved_count
+ $hyp->resolved_propositions->resolved_count
];
}
@alt
],
next_step => DX::Step::InvokeNextPredicate->new(
- proposition => $self->next_proposition,
+ proposition => $self->next_proposition($new_hyp),
),
);
}
sub _apply_to_hyp {
my ($self, $old_hyp) = @_;
return undef unless my $hyp = $old_hyp->with_actions(@{$self->actions});
- return $hyp->resolve_head_dependent_on($self->depends_on);
+ return $hyp->with_resolution($self->resolves, $self->depends_on);
}
1;