001/**
002 * Copyright (C) 2007 - 2016, Jens Lehmann
003 *
004 * This file is part of DL-Learner.
005 *
006 * DL-Learner is free software; you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation; either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * DL-Learner is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018 */
019package org.dllearner.refinementoperators;
020
021import org.dllearner.utilities.owl.OWLClassExpressionLengthMetric;
022import org.dllearner.utilities.owl.OWLClassExpressionUtils;
023import org.semanticweb.owlapi.model.OWLClassExpression;
024
025import java.util.List;
026import java.util.Set;
027
028/**
029 * A refinement operator for which the syntactic length of the generated
030 * refinements can be limited.
031 * 
032 * @author Jens Lehmann
033 *
034 */
035public interface LengthLimitedRefinementOperator extends RefinementOperator {
036
037        /**
038         * Optional refinement operation, where the learning algorithm can
039         * specify an additional bound on the length of descriptions. 
040         * 
041         * @param description The description, which will be refined.
042         * @param maxLength The maximum length of returned description, where length is defined by {@link OWLClassExpressionUtils#getLength(OWLClassExpression)} }.
043         * @return A set of refinements obeying the above restrictions.
044         */
045        Set<OWLClassExpression> refine(OWLClassExpression description, int maxLength);
046                
047        /**
048         * Optional refinement operation, where the learning algorithm can
049         * specify an additional bound on the length of descriptions and
050         * a list of known refinements, which do not need to be returned. 
051         * 
052         * @param description The description, which will be refined.
053         * @param maxLength The maximum length of returned description, where length is defined by {@link OWLClassExpressionUtils#getLength(OWLClassExpression)}.
054         * @param knownRefinements A collection of known refinements, which do not need to be returned. 
055         * @return A set of refinements obeying the above restrictions.
056         */
057        Set<OWLClassExpression> refine(OWLClassExpression description, int maxLength, List<OWLClassExpression> knownRefinements);
058
059        void setLengthMetric(OWLClassExpressionLengthMetric lengthMetric);
060
061        OWLClassExpressionLengthMetric getLengthMetric();
062}