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.api;
018
019import java.util.Collection;
020
021import net.automatalib.words.Word;
022import de.learnlib.oracles.DefaultQuery;
023
024/**
025 * Membership oracle interface. A membership oracle provides an elementary abstraction
026 * to a System Under Learning (SUL), by allowing to pose {@link DefaultQuery}s: A query is a sequence
027 * of input symbols (divided into a prefix and a suffix part, cf. {@link DefaultQuery#getPrefix()}
028 * and {@link DefaultQuery#getSuffix()}, in reaction to which the SUL produces a specific observable
029 * behavior (outputting a word, acceptance/rejection etc.).
030 * 
031 * @author Malte Isberner <malte.isberner@gmail.com>
032 * @author Maik Merten <maikmerten@googlemail.com>
033 * 
034 * @see DefaultQuery
035 */
036public interface MembershipOracle<I, O> {
037        
038        public static interface DFAMembershipOracle<I> extends MembershipOracle<I,Boolean> {}
039        public static interface MealyMembershipOracle<I,O> extends MembershipOracle<I,Word<O>> {}
040        
041        /**
042         * Processes the specified collection of queries. When this method returns,
043         * the output field of each of the contained queries should reflect the SUL
044         * response to the respective query.
045         * 
046         * @param queries the queries to process
047         * @see DefaultQuery#getOutput()
048         */
049        public void processQueries(Collection<? extends Query<I, O>> queries);
050}