1 package DX::Step::ConsiderProposition;
7 has proposition => (is => 'ro', isa => Proposition, required => 1);
11 my $hyp = $ss->current_hypothesis;
14 [ symbol => 'consider' ],
15 @{$self->proposition->for_deparse->[1]},
18 my $old_scope = (my $old_hyp = $ss->current_hypothesis)->scope;
19 my @old_locals = @{$old_scope->locals};
20 my $top_level = $#old_locals;
21 my $top = pop @old_locals;
22 my $top_members = $top->members;
23 my @new_names = grep !exists $top_members->{$_},
24 keys %{$self->proposition->introduced_names};
25 my $new_scope = $old_scope->but(
28 $top->but(members => {
30 map +($_ => DX::Value::Unset->new(
31 action_builder => DX::ActionBuilder::UnsetValue->new(
32 target_path => [ $top_level, $_ ],
39 %{$old_scope->lex_map},
40 map +($_ => [ $top_level, $_ ]), @new_names
43 my $new_hyp = $old_hyp->but(scope => $new_scope);
45 current_hypothesis => $new_hyp,
46 next_step => $self->proposition->resolve_for($new_scope)