Skip to content

Commit

Permalink
Update DecisionTree.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Oct 5, 2023
1 parent fc9422f commit c24965e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Draco.Compiler/Internal/FlowAnalysis/DecisionTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ private sealed class Node : INode
public Arm? ActionArm { get; set; }
public TAction? Action => this.ActionArm?.Action;
public bool IsFail => this.PatternMatrix.Count == 0;
// TODO
public BoundPattern? NotCovered => throw new NotImplementedException();
public BoundPattern? NotCovered { get; set; }
public BoundExpression MatchedValue => this.Arguments[0];
public List<KeyValuePair<BoundPattern, INode>> Children { get; } = new();
IReadOnlyList<KeyValuePair<BoundPattern, INode>> INode.Children => this.Children;
Expand Down Expand Up @@ -354,6 +353,8 @@ private void Build(Node node)
var @default = this.Default(node);
// Add as child
node.Children.Add(new(BoundDiscardPattern.Default, @default));
// If it's a failure node, add counterexample
if (@default.IsFail) @default.NotCovered = uncoveredDomain.SamplePattern();
}

// Recurse to children
Expand Down

0 comments on commit c24965e

Please sign in to comment.