-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCompositeMinterm.cs
34 lines (31 loc) · 1 KB
/
CompositeMinterm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Collections.Generic;
using System.Linq;
namespace Algorithm.Minterms
{
/// <summary>
/// A model for a minterm composed of other minterms.
/// </summary>
public class CompositeMinterm : MintermBase
{
private List<MintermBase> Minterms { get; }
/// <summary>
/// Constructs a composite minterm.
/// </summary>
/// <param name="variables">The logical variables at this step.</param>
/// <param name="inBinary">The binary representation of the variables.</param>
/// <param name="minterms">The minterms used during the combination.</param>
public CompositeMinterm
(
List<Variable> variables,
string inBinary,
params MintermBase[] minterms
)
{
Variables = variables;
InBinary = inBinary;
Minterms = minterms.ToList();
}
public override string ToString()
=> $"({string.Join(", ", Minterms)})";
}
}