Examples of ErlangModule


Examples of org.intellij.erlang.psi.ErlangModule

    return new PsiLocation<PsiElement>(project, f);
  }

  @Nullable
  private static Location getModuleLocation(Project project, ErlangFile file) {
    ErlangModule module = file.getModule();
    return module != null ? new PsiLocation<PsiElement>(project, module) : null;
  }
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

      if (f.getName().endsWith(".erl")) {
        // load the module
        try {
          System.out.println("Loading " + f.getName());
          Configuration config = Configuration.getDefaultConfiguration().copy();ErlangModule.setupErlangConfiguration(config,f);
          ErlangModule mod = ErlangModule.loadModule(config);
          DirectedSparseVertex myVertex = getVertex(mod.name);
          myVertex.setUserDatum(JUConstants.COLOUR, JUConstants.RED, UserData.SHARED);

          for (String d : mod.behaviour.getDependencies()) {
            DirectedSparseVertex v = getVertex(d);
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

  public void testLearningFromErlangTraceFile2() throws IOException
  {
    ErlangModule.setupErlangConfiguration(config,new File(lockerFile));
        config.setErlangAlphabetAnyElements(EXPANSIONOFANY.ANY_WIBBLE);
        config.setErlangCompileIntoBeamDirectory(true);
    ErlangModule mod = ErlangModule.loadModule(config);
    Set<ErlangLabel> alphabetA = new TreeSet<ErlangLabel>();alphabetA.addAll(mod.behaviour.getAlphabet());
    ErlangModule.flushRegistry();

    ErlangModule.setupErlangConfiguration(config,new File(lockerFile));
    config.setErlangAlphabetAnyElements(EXPANSIONOFANY.ANY_WIBBLE);config.setErlangCompileIntoBeamDirectory(true);
    ErlangModule modSame = ErlangModule.loadModule(config);
    Assert.assertTrue(alphabetA.equals(modSame.behaviour.getAlphabet()));// check that the same alphabet will be loaded second time.
    ErlangModule.flushRegistry();
   
    createLogFileFromExistingLog("earlier_failure2.txt");
    ErlangOracleLearner learner = ErlangQSMOracle.createLearner(null,modifiedLogFile);
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

    ErlangModule.setupErlangConfiguration(learnerConfig.config,new File(ErlangExamples+"/frequency/frequencyBroken.erl"));
    learnerConfig.config.setErlangAlphabetAnyElements(EXPANSIONOFANY.ANY_WIBBLE);learnerConfig.config.setTransitionMatrixImplType(STATETREE.STATETREE_SLOWTREE);
    learnerConfig.config.setErlangInitialTraceLength(3);
    learnerConfig.config.setErlangStripModuleNamesFromFunctionsInNonGenModules(true);
   
    ErlangModule mod = ErlangModule.loadModule(learnerConfig.config);
    OtpErlangTuple startFunType=mod.sigTypes.get("frequencyBroken:start/0");
    Map<String,OtpErlangTuple> override = new TreeMap<String,OtpErlangTuple>();
    override.put("frequencyBroken:start/0", new OtpErlangTuple(new OtpErlangObject[]{startFunType.elementAt(0),startFunType.elementAt(1),startFunType.elementAt(2),startFunType.elementAt(3),
        ErlangLabel.parseText("{'Func',[],[],{'Any',[]}}")}));
    mod.rebuildSigs(learnerConfig.config, override);
    mod.behaviour.generateAlphabet(config);
    ErlangOracleLearner learner = new ErlangOracleLearner(null,learnerConfig);
    LearnerGraph frequencyE = new LearnerGraph(learnerConfig.config);
    learner.init(learner.GenerateInitialTraces(learnerConfig.config.getErlangInitialTraceLength()),0,0);
   
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

   * @param traces traces to convert
   * @return outcome of conversion
   */
  public static Set<List<Label>> convertTracesToErl(Set<List<Label>> traces, Configuration config)
  {
    ErlangModule mod = ErlangModule.findModule(config.getErlangModuleName());
    Set<List<Label>> convertedTraces = null;
    ConvertALabel converter = mod.behaviour.new ConverterErlToMod();
    convertedTraces = new HashSet<List<Label>>();
    for(List<Label> list:traces) convertedTraces.add(OTPBehaviour.convertTrace(list, converter));
    return convertedTraces;
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

                if (ErlangRunner.validName(f.getName()))
                    ErlangRunner.compileErl(f,ErlangRunner.getRunner());

            for (Object s : modules.getSelectedValues())
            {
                ErlangModule m = (ErlangModule) s;
                // Create an Erlang QSM jobby for the selected behaviours...
                ErlangOracleRunner runner = new ErlangOracleRunner(m, app.modules);
                Thread t = new Thread(runner);t.setPriority(Thread.MIN_PRIORITY);
                t.start();
            }
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

       * ErlangRunner.getRunner());
       */
      for (Object s : app.modules) {
        try {
          // Load the module
          ErlangModule m = (ErlangModule) s;

          int len = Integer.parseInt(lenField.getText());
          boolean exhaustAlphabet = exhaustAlphabetBox.isSelected();
          boolean useOutputMatching = outputMatchingBox.isSelected();
          EXPANSIONOFANY expansion = ((InnerAlphabetModel)anyAlphabet.getModel()).getSelectedExpansion();
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

   * @param traces traces to convert
   * @return outcome of conversion
   */
  public static Set<List<Label>> convertTracesToErl(Set<List<Label>> traces, Configuration config)
  {
    ErlangModule mod = ErlangModule.findModule(config.getErlangModuleName());
    Set<List<Label>> convertedTraces = null;
    ConvertALabel converter = mod.behaviour.new ConverterErlToMod();
    convertedTraces = new HashSet<List<Label>>();
    for(List<Label> list:traces) convertedTraces.add(OTPBehaviour.convertTrace(list, converter));
    return convertedTraces;
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

  /* The two arguments to this one are the graph to load and the .erl source of the module it corresponds to. The graphs should be saved via the "save" entry in the pop-up menu of ErlangOracleVisualiser. */
  public static void main(String[] args) throws IOException
  {
    File file = new File(args[1]);
    Configuration cnf = Configuration.getDefaultConfiguration().copy();ErlangModule.setupErlangConfiguration(cnf,file);
    ErlangModule mod = ErlangModule.loadModule(cnf);

    LearnerGraphND grOrig = new LearnerGraphND(cnf);
    AbstractPersistence.loadGraph(args[0], grOrig,null);

    final LearnerGraph erlangGraph = new LearnerGraph(grOrig.config);
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

   * @param traces traces to convert
   * @return outcome of conversion
   */
  public static Set<List<Label>> convertTracesToErl(Set<List<Label>> traces, Configuration config)
  {
    ErlangModule mod = ErlangModule.findModule(config.getErlangModuleName());
    Set<List<Label>> convertedTraces = null;
    ConvertALabel converter = mod.behaviour.new ConverterErlToMod();
    convertedTraces = new HashSet<List<Label>>();
    for(List<Label> list:traces) convertedTraces.add(OTPBehaviour.convertTrace(list, converter));
    return convertedTraces;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.