import net.sf.javaml.core.* import net.sf.javaml.distance.* import java.util.logging.Logger import java.util.logging.Level import Sequenic.T3.Config import Sequenic.T3.Sequence.Datatype.SUITE import Sequenic.T3.Generator.Generator import static Sequenic.T3.Generator.GenCombinators.FirstOf import static Sequenic.T3.Generator.Value.ValueMGCombinators.* import Sequenic.T3.T3groovyAPI import Sequenic.T3.SuiteUtils.Query.* import static Sequenic.T3.SuiteUtils.Query.StepPredicate.* import static Sequenic.T3.SuiteUtils.Query.SeqPredicate.* import static Sequenic.T3.SuiteUtils.Query.LTLQuery.* import static Sequenic.T3.SuiteUtils.Query.Alg2Query.* import static Sequenic.T3.SuiteUtils.Query.Equation.* import Sequenic.T3.SuiteUtils.Inference.InvariantFile import Sequenic.T3.SuiteUtils.Inference.SubcaseInvariantFile import java.util.LinkedList ; logger = Logger.getLogger(net.sf.javaml.core.DefaultDataset.class.getName()) logger.setLevel(Level.SEVERE) config = new Config(CUT : net.sf.javaml.core.DefaultDataset, regressionMode : true, injectOracles : false, fieldUpdateProbability : 0, maximizePrefix : false, maxPrefixLength : 5, maxSuffixLength : 2, suiteSizeMultiplierPerGoal : 7 ) static Instance genInst(int k) { switch (k) { case 0 : println (">> Instance 1") ; return new DenseInstance(null) ; case 1 : double[] a = [] ; println (">> Instance 2") ; return new DenseInstance(a) ; case 2 : double[] a = [0] ; println (">> Instance 3") ; return new DenseInstance(a) ; } } static Instance genCollection(int k) { switch (k) { case 0 : println (">> Set 1") ; return new LinkedList() ; case 1 : double[] a = [0] as double[] ; println (">> Set 2") ; return [new DenseInstance(a)] ; case 2 : double[] a = [0] as double[] ; double[] b = [1] as double[] ; println (">> Set 3") ; return [new DenseInstance(a), new DenseInstance(b)] ; } } static Instance genDist(int k) { switch (k) { case 0 : println (">> Dist 1") ; return new NormDistance(1) ; case 0 : println (">> Dist 2") ; return new NormDistance(2) ; case 0 : println (">> Dist 3") ; return new NormDistance(4) ; } } gen1 = FirstOf( Integer(OneOf(-1,0,1,2,99999)), Object(genDefaultDataset,"genInst",OneOf(0,1,2)).If(hasClass(DenseInstance)), Object(genDefaultDataset,"genDist",OneOf(0,1,2)).If(hasClass(NormDistance)), Object(genDefaultDataset,"genCollection",OneOf(0,1,2)) .If(hasParamName("c").or(hasParamName("coll"))) ) t3a = new T3groovyAPI(config) t3b = new T3groovyAPI(gen1,config) generator = { t3b.ADT() } suite = generator() t3b.info(suite)