rename alternatives to adjustments
[scpubgit/DX.git] / lib / DX / Deparse.pm
index 2d3b2ac..ce3f177 100644 (file)
@@ -81,7 +81,7 @@ sub _fmt_hypothesis {
   my ($self, $hyp, $meta) = @_;
   $self->_fmt_object([
     map [ $_ => $hyp->$_ ],
-      qw(actions outstanding_propositions resolved_propositions scope)
+      qw(actions resolved_propositions scope)
   ], $meta);
 }
 
@@ -176,9 +176,42 @@ sub _fmt_scope {
 sub _fmt_searchstate {
   my ($self, $ss, $meta) = @_;
   $self->_fmt_object([
-    [ alternatives => '{...}' ],
+    [ adjustments_made => '{...}' ],
     [ current_hypothesis => $ss->current_hypothesis ],
   ], $meta);
 }
 
+sub _fmt_step_considerproposition {
+  my ($self, $step, $meta) = @_;
+  'consider '.$self->_fmt($step->proposition, $meta);
+}
+
+sub _fmt_step_resolveproposition {
+  my ($self, $step, $meta) = @_;
+  'resolve '.$self->_fmt_object([
+    [ actions => $step->actions ],
+    ($step->alternative_step
+      ? [ alternative_step => '...' ]
+      : ()),
+    [ depends_on => [
+      map bless([ @$_ ], 'DX::Dependency'),
+        map @{$_}[1..$#$_],
+          @{$step->depends_on}
+    ] ],
+  ], $meta);
+}
+
+sub _fmt_step_backtrack { 'backtrack' }
+
+sub _fmt_step_markassolution { 'mark as solution' }
+
+sub _fmt_step_enterrecheck {
+  my ($self, $step, $meta) = @_;
+  'recheck '.$self->_fmt($step->proposition_list->[0], $meta);
+}
+
+sub _fmt_step_completerecheck { 'complete recheck' }
+
+sub _fmt_step_failrecheck { 'fail recheck' }
+
 1;