001/* Copyright (C) 2013 TU Dortmund
002 * This file is part of LearnLib, http://www.learnlib.de/.
003 * 
004 * LearnLib is free software; you can redistribute it and/or
005 * modify it under the terms of the GNU Lesser General Public
006 * License version 3.0 as published by the Free Software Foundation.
007 * 
008 * LearnLib is distributed in the hope that it will be useful,
009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
011 * Lesser General Public License for more details.
012 * 
013 * You should have received a copy of the GNU Lesser General Public
014 * License along with LearnLib; if not, see
015 * <http://www.gnu.de/documents/lgpl.en.html>.
016 */
017package de.learnlib.algorithms.lstargeneric.table;
018
019
020/**
021 * A description of an inconsistency in an {@link ObservationTable}. An inconsistency
022 * consists of two short prefixes <code>u</code>, <code>u'</code> with identical contents,
023 * and an input symbol <code>a</code>, such that the rows for <code>ua</code> and <code>u'a</code>
024 * have different contents.
025 * 
026 * @author Malte Isberner <malte.isberner@gmail.com>
027 *
028 * @param <I> input symbol class
029 * @param <O> output class
030 */
031public final class Inconsistency<I, O> {
032        private final Row<I> firstRow;
033        private final Row<I> secondRow;
034        private final int inputIndex;
035        
036        /**
037         * Constructor.
038         * @param firstRow the first row
039         * @param secondRow the second row
040         * @param inputIndex the input symbol for which the successor rows differ
041         */
042        public Inconsistency(Row<I> firstRow, Row<I> secondRow, int inputIndex) {
043                this.firstRow = firstRow;
044                this.secondRow = secondRow;
045                this.inputIndex = inputIndex;
046        }
047        
048        /**
049         * Retrieves the first row.
050         * @return the first row
051         */
052        public Row<I> getFirstRow() {
053                return firstRow;
054        }
055        
056        /**
057         * Retrieves the second row.
058         * @return the second row
059         */
060        public Row<I> getSecondRow() {
061                return secondRow;
062        }
063        
064        /**
065         * Retrieves the index of the input symbol for which the successor rows differ.
066         * @return the input symbol index
067         */
068        public int getInputIndex() {
069                return inputIndex;
070        }
071}