All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.uu.cs.ape.models.sltlxStruc.SLTLxFinally Maven / Gradle / Ivy

Go to download

APE is a command line tool and an API for the automated exploration of possible computational pipelines (workflows) from large collections of computational tools.

There is a newer version: 2.3.0
Show newest version
package nl.uu.cs.ape.models.sltlxStruc;

import java.util.HashSet;
import java.util.Set;

import nl.uu.cs.ape.solver.minisat.SATSynthesisEngine;

/**
 * Structure used to model Finally (F) modal statement in SLTLx.
 * 
 * @author Vedran Kasalica
 *
 */
public class SLTLxFinally extends SLTLxFormula {

	private SLTLxFormula formula;

	public SLTLxFinally(SLTLxFormula formula) {
		super();
		this.formula = formula;
	}

	@Override
	public Set getCNFEncoding(int stateNo, SLTLxVariableSubstitutionCollection variableMapping,
			SATSynthesisEngine synthesisEngine) {
		Set> allClauses = new HashSet<>();

		/*
		 * Disjoint the collection of clauses that encode the formula at each of the
		 * workflow steps.
		 */
		for (int i = stateNo; i <= synthesisEngine.getSolutionSize(); i++) {
			allClauses.add(formula.getCNFEncoding(i, variableMapping, synthesisEngine));
		}
		return CNFClause.disjoinClausesCollection(allClauses);
	}

	@Override
	public Set getNegatedCNFEncoding(int stateNo, SLTLxVariableSubstitutionCollection variableMapping,
			SATSynthesisEngine synthesisEngine) {
		Set> allClauses = new HashSet<>();

		/*
		 * Conjunct the collection of clauses that encode negation the formula at each
		 * of the workflow steps.
		 */
		for (int i = stateNo; i <= synthesisEngine.getSolutionSize(); i++) {
			allClauses.add(formula.getNegatedCNFEncoding(i, variableMapping, synthesisEngine));
		}
		return CNFClause.conjunctClausesCollection(allClauses);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy