Package com.hpctoday.fada.integersolver

Examples of com.hpctoday.fada.integersolver.Solver


        for (Inequation ita : added_constraints)
          system.add(ita);

        log.trace("Solver 01");
        Solver solver = SolverFactory.createSolver();
        solver.set(GetStmt2(),GetDeep(),__new_variables,__local_parameters,system);
        /*
         * cout<<"\n Solver = \n"; solver.Print();
         */
        Quast local__result = solver.Max();
        /*
         * cout<<"\n local = \n"; local__result.Print();
         */
        local__result.SubstituteByString(__mapping_counters_alphas);
        result = result.Max(local__result);
        // cout<<"\n final = \n";
        // result.Print();
        // getchar();
      }
      parameter_of_maximum.add(_alpha.toString());
      result.SubstituteByString(__mapping_counters_alphas);
      result = result.EliminateRedondantLeaves(false);
      result = result.Simplify(affine_environment, GetParameters());
      // result=result.Compress();
      SetQuast(result);
    } else {
      log.trace("Not IsThereNonAffineConstraints");
     
      // all constraints are affine ==> compute the exact definition
      List<String> __local_parameters = GetParameters();
      Quast result = new Quast(); // _|_
      // build affine systems
      //int i = 0;
     
      log.trace("AffineValidStmt2: " + affine_valid_stmt2.size());
     
      for (List<Inequation> itw : affine_valid_stmt2) {

        // valid read
        List<Inequation> system = new ArrayList<Inequation>();// =*itr;
        // if(affine_environment.size()>0);
        // system=*affine_environment.begin();

        // valid write
        for (Inequation iti : itw)
          system.add(iti);

        // lexicographic precedence
        for (Inequation itp : precedence)
          system.add(itp);

        // same variable
        for (Inequation itsc : affine_index_equality)
          system.add(itsc);

        log.trace("Solver 02");
        Solver solver = SolverFactory.createSolver();
        solver.set(GetStmt2(),GetDeep(),stmt2_iteration,__local_parameters,system);
        Quast local_result = solver.Max();
        log.trace("Local Result: " + local_result);
        result = result.Max(local_result);
      }

     
View Full Code Here


  public ContextQuast TraduceToQuast(List<List<Inequation>> env, List<String> __param) {
    if (IsAffine()) {
      // cout<<"\nLogicalClause::TraduceToQuast...............[debug]\n";
      // cout<<"\n ENV = "<<PrintInequations(&env);
      Solver solver = SolverFactory.createSolver();
      solver.set(-1, -1, variables, __param, affine_inequations);
      Quast max = solver.Max();

      ContextQuast context = Global.TraduceToContextQuast(max, variables, Global.EliminateDoubles(RHS2Inequations()));
      // cout<<"\nTraduit direct .......\n"<<context.Print_str("\n");
      context = context.Simplify(env, __param);
      // cout<<"\nsimplifié .......\n"<<context.Print_str("\n");
View Full Code Here

  public static boolean IsUnsatisfiable1(List<Inequation> constraints, List<String> parameters) {
    List<String> var = new ArrayList<String>();

    log.trace("=======IsUnsatisfiable***********************************");
    Solver s = SolverFactory.createSolver();
    s.set(-1, -1, RemoveDoubles(parameters), var, constraints);
    Quast m = s.Max();
   

      log.trace("=======IsUnsatisfiable (END)***********************************");
    if (m.IsLeaf() && m.IsEmpty())
      return true;
View Full Code Here

    List<String> empty = new ArrayList<String>();
    all.addAll(Global.MergeInequations(precedence, GetKnowledge().GetAffineInequations()));
    all_var.addAll(Global.MergeVariables(param, GetKnowledge().GetVariables()));
    // cout<<"\nAttachedClauses::IsAccurate....\n"<<PrintInequations(&all);

    Solver s = SolverFactory.createSolver();
    s.set(-1, -1, all_var, empty, all);
    all.clear();
    Quast max = s.Max().EliminateRedondantLeaves(true);
    boolean res = false;

    if (max.IsLeaf() && !max.IsEmpty())
      res = true;
    // cout<<" .........."<<res<<"\n";
View Full Code Here

TOP

Related Classes of com.hpctoday.fada.integersolver.Solver

Copyright © 2018 www.massapicom. 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.