<commit_before>/* Copyright (C) 2013 TU Dortmund
 * This file is part of LearnLib, http://www.learnlib.de/.
 * 
 * LearnLib is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 3.0 as published by the Free Software Foundation.
 * 
 * LearnLib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with LearnLib; if not, see
 * <http://www.gnu.de/documents/lgpl.en.html>.
 */
package de.learnlib.eqtests.timed;

import java.util.Collection;
import java.util.List;
import net.automatalib.commons.util.collections.CollectionsUtil;
import net.automatalib.words.Word;
import de.learnlib.api.EquivalenceOracle;
import de.learnlib.api.SULTimed;
import de.learnlib.oracles.DefaultQuery;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Map;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.automatalib.automata.concepts.MutableTransitionOutput;
import net.automatalib.automata.transout.MealyMachine;
import net.automatalib.automata.transout.impl.compact.CompactMealy;

/**
 * Finds transitions with uncertain clock guards and "trims" them to smallest equivalent.
 * 
 * Performs a complete exploration checking for outputs tagged with [?] clock guards.
 * The step clock limit is trimmed and output compared to see if the trim still results in equivalence.
 * 
 * Based on CompleteExplorationEQOracle by Malte Isberner.
 * 
 * @author <NAME> <<EMAIL>>
 *
 * @param <I> input symbol class
 * @param <O> output class
 */
public class ClockExplorationEQOracle<I, O> implements
		EquivalenceOracle.MealyEquivalenceOracle<I,O> {
	
	private int minDepth;
	private int maxDepth;
	private final SULTimed<I, O> sul;
        private final static Logger LOGGER = Logger.getGlobal();
	private long trimTime = 1000L; // the amount of time to trim off clock guards<commit_msg>Moved comment regarding clock trimming into this project<commit_after>/* Copyright (C) 2013 <NAME>
 * This file is part of LearnLib, http://www.learnlib.de/.
 * 
 * LearnLib is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 3.0 as published by the Free Software Foundation.
 * 
 * LearnLib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with LearnLib; if not, see
 * <http://www.gnu.de/documents/lgpl.en.html>.
 */
package de.learnlib.eqtests.timed;

import java.util.Collection;
import java.util.List;
import net.automatalib.commons.util.collections.CollectionsUtil;
import net.automatalib.words.Word;
import de.learnlib.api.EquivalenceOracle;
import de.learnlib.api.SULTimed;
import de.learnlib.oracles.DefaultQuery;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Map;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.automatalib.automata.concepts.MutableTransitionOutput;
import net.automatalib.automata.transout.MealyMachine;
import net.automatalib.automata.transout.impl.compact.CompactMealy;

/**
 * Finds transitions with uncertain clock guards and "trims" them to smallest equivalent.
 * 
 * Performs a complete exploration checking for outputs tagged with [?] clock guards.
 * The step clock limit is trimmed and output compared to see if the trim still results in equivalence.
 *         
 * Clock discovery walk:
 * 1) For each outgoing transition check the guard on the output and see if we can do it faster
 * 2) The output must match the hypothesis output
 * 3) The successor state signature must match the hypothesis successor state signature
 * 4) If output and successor match then "trim" the clock guard
 * 
 * Based on CompleteExplorationEQOracle by <NAME>.
 * 
 * @author <NAME> <<EMAIL>>
 *
 * @param <I> input symbol class
 * @param <O> output class
 */
public class ClockExplorationEQOracle<I, O> implements
		EquivalenceOracle.MealyEquivalenceOracle<I,O> {
	
	private int minDepth;
	private int maxDepth;
	private final SULTimed<I, O> sul;
        private final static Logger LOGGER = Logger.getGlobal();
	private long trimTime = 1000L; // the amount of time to trim off clock guards
{'fraction_non_alphanumeric': 0.0815697554961989, 'fraction_numerical': 0.004931169098006986, 'mean_word_length': 4.445190156599552, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '144866', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1349, 'n_words': 525}