protected override void CheckConstraints() { base.CheckConstraints(); if (base.Alphabet.Intersect(BandAlphabet).Count() != base.Alphabet.Length) { throw new AlphabetException("Inputalphabet not in Bandalphabet", this); } if (!BandAlphabet.Contains(BlankSymbol)) { throw new AlphabetException(BlankSymbol, this); } foreach (var item in Transforms) { if (item.Key.q >= StatesCount) { throw new StateException(item.Key.q, this); } foreach (char c in item.Key.c) { if (!BandAlphabet.Contains(c)) { throw new AlphabetException(c, this); } } } }
protected override void CheckConstraints() { base.CheckConstraints(); foreach (var ti in Transforms) { if (ti.Value.qNext >= StatesCount) { throw new StateException(ti.Value.qNext, this); } if (!BandAlphabet.Contains(ti.Value.c2)) { throw new AlphabetException(ti.Value.c2, this); } } }
protected override void CheckConstraints() { base.CheckConstraints(); foreach (var ti in Transforms) { foreach (char c in ti.Key.c) { if (!BandAlphabet.Contains(c)) { throw new Automat.AlphabetException(c, this); } } foreach (char c in ti.Value.c2) { if (!BandAlphabet.Contains(c)) { throw new Automat.AlphabetException(c, this); } } if (Alphabet.Contains(BlankSymbol)) { throw new Automat.AlphabetException(BlankSymbol, this); } if (ti.Key.q >= StatesCount) { throw new Automat.StateException(ti.Key.q, this); } if (ti.Value.qNext >= StatesCount) { throw new Automat.StateException(ti.Value.qNext, this); } } }