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.closing;
018
019import java.util.List;
020
021import de.learnlib.algorithms.lstargeneric.table.ObservationTable;
022import de.learnlib.algorithms.lstargeneric.table.Row;
023import de.learnlib.api.MembershipOracle;
024
025/**
026 * A closing strategy, determining how to proceed when an observation table needs to be closed.
027 * 
028 * @author Malte Isberner <malte.isberner@gmail.com>
029 *
030 * @param <I> type variable for input symbol upper bound.
031 * @param <O> type variable for output symbol upper bound.
032 */
033public interface ClosingStrategy<I, O> {
034        /**
035         * Given a list of row equivalence classes, this method selects for each of the classes
036         * one (representative) row which is being closed. This corresponds to selecting one of several
037         * long prefixes (i.e., transitions reaching an unknown state) to be an access sequence.
038         * <p>
039         * By contract, the size of the the returned list <b>must</b> equal the size of the
040         * <code>unclosedClasses</tt> argument.
041         * 
042         * @param unclosedClasses the list of row equivalence classes
043         * @param table the observation table
044         * @param oracle the membership oracle
045         * @return a selection of representative rows to be closed.
046         */
047        public <RI extends I,RO extends O>
048        List<Row<RI>> selectClosingRows(List<List<Row<RI>>> unclosedClasses, ObservationTable<RI,RO> table,
049                        MembershipOracle<RI,RO> oracle);
050}