public static ExplorationStage <T> PrependPath <T>( this ExplorationStage <T> explorationStage, IEnumerable <int> path) => explorationStage.Match( onNonCounterexampleExploration: nonCounterexample => ExplorationStage <T> .Factory.NonCounterexample( nonCounterexample.ExampleSpace, Enumerable.Concat(path, nonCounterexample.Path)), onCounterexampleExploration: counterexample => ExplorationStage <T> .Factory.Counterexample( counterexample.ExampleSpace, Enumerable.Concat(path, counterexample.Path), counterexample.Exception), onDiscardExploration: (discard) => ExplorationStage <T> .Factory.Discard(discard.ExampleSpace));
public static IExampleSpace <T> ExampleSpace <T>(this ExplorationStage <T> explorationStage) => explorationStage.Match( onCounterexampleExploration: counterexample => counterexample.ExampleSpace, onNonCounterexampleExploration: nonCounterexample => nonCounterexample.ExampleSpace, onDiscardExploration: discard => discard.ExampleSpace);
public static bool IsCounterexample <T>(this ExplorationStage <T> explorationStage) => explorationStage.Match( onCounterexampleExploration: (_) => true, onNonCounterexampleExploration: (_) => false, onDiscardExploration: (_) => false);