Search in sources :

Example 6 with AgreeASTBuilder

use of com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder in project AMASE by loonwerks.

the class FaultsVerifyAllHandler method wrapVerificationResult.

@Override
protected void wrapVerificationResult(ComponentInstance si, CompositeAnalysisResult wrapper) {
    AgreeProgram agreeProgram = new AgreeASTBuilder().getAgreeProgram(si, isMonolithic());
    // generate different lustre depending on which model checker we are
    // using
    Program program;
    if (AgreeUtils.usingKind2()) {
        if (!isMonolithic()) {
            throw new AgreeException("Kind2 now only supports monolithic verification");
        }
        program = LustreContractAstBuilder.getContractLustreProgram(agreeProgram);
    } else {
        program = LustreAstBuilder.getAssumeGuaranteeLustreProgram(agreeProgram);
    }
    List<Pair<String, Program>> consistencies = LustreAstBuilder.getConsistencyChecks(agreeProgram);
    wrapper.addChild(createVerification("Contract Guarantees", si, program, agreeProgram, AnalysisType.AssumeGuarantee));
    for (Pair<String, Program> consistencyAnalysis : consistencies) {
        wrapper.addChild(createVerification(consistencyAnalysis.getFirst(), si, consistencyAnalysis.getSecond(), agreeProgram, AnalysisType.Consistency));
    }
}
Also used : Program(jkind.lustre.Program) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram) AgreeASTBuilder(com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram) AgreeException(com.rockwellcollins.atc.agree.analysis.AgreeException) Pair(org.eclipse.xtext.util.Pair)

Example 7 with AgreeASTBuilder

use of com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder in project AMASE by loonwerks.

the class GenMCSHandler method wrapVerificationResult.

@Override
protected void wrapVerificationResult(ComponentInstance si, CompositeAnalysisResult wrapper) {
    AgreeProgram agreeProgram = new AgreeASTBuilder().getAgreeProgram(si, isMonolithic());
    Program program;
    if (AgreeUtils.usingKind2()) {
        if (!isMonolithic()) {
            throw new AgreeException("Kind2 now only supports monolithic verification");
        }
        program = LustreContractAstBuilder.getContractLustreProgram(agreeProgram);
    } else {
        program = LustreAstBuilder.getAssumeGuaranteeLustreProgram(agreeProgram);
    }
    wrapper.addChild(createVerification("Contract Guarantees", si, program, agreeProgram, AnalysisType.AssumeGuarantee));
}
Also used : Program(jkind.lustre.Program) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram) AgreeASTBuilder(com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram) AgreeException(com.rockwellcollins.atc.agree.analysis.AgreeException)

Example 8 with AgreeASTBuilder

use of com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder in project AGREE by loonwerks.

the class VerifyHandler method wrapVerificationResult.

protected void wrapVerificationResult(ComponentInstance si, CompositeAnalysisResult wrapper) {
    AgreeProgram agreeProgram = new AgreeASTBuilder().getAgreeProgram(si, isMonolithic());
    // generate different lustre depending on which model checker we are
    // using
    Program program;
    if (AgreeUtils.usingKind2()) {
        if (!isMonolithic()) {
            throw new AgreeException("Kind2 now only supports monolithic verification");
        }
        program = LustreContractAstBuilder.getContractLustreProgram(agreeProgram);
    } else {
        program = LustreAstBuilder.getAssumeGuaranteeLustreProgram(agreeProgram);
    }
    List<Pair<String, Program>> consistencies = LustreAstBuilder.getConsistencyChecks(agreeProgram);
    wrapper.addChild(createVerification("Contract Guarantees", si, program, agreeProgram, AnalysisType.AssumeGuarantee));
    for (Pair<String, Program> consistencyAnalysis : consistencies) {
        wrapper.addChild(createVerification(consistencyAnalysis.getFirst(), si, consistencyAnalysis.getSecond(), agreeProgram, AnalysisType.Consistency));
    }
}
Also used : Program(jkind.lustre.Program) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram) AgreeASTBuilder(com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram) AgreeException(com.rockwellcollins.atc.agree.analysis.AgreeException) Pair(org.eclipse.xtext.util.Pair)

Example 9 with AgreeASTBuilder

use of com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder in project AGREE by loonwerks.

the class AGREESimulationEngineFactoryHelper method createSimulationEngine.

public static SimulationEngine createSimulationEngine(final SystemInstance systemInstance, final ExceptionHandler exceptionHandler, final SimulationProgramType type) {
    Objects.requireNonNull(systemInstance, "systemInstance must not be null");
    Objects.requireNonNull(exceptionHandler, "exceptionHandler must not be null");
    // Check that the component type is compatible
    if (!isCompatible(systemInstance.getComponentImplementation())) {
        final ComponentType componentType = systemInstance.getComponentClassifier().getType();
        throw new RuntimeException(componentType.getName() + " does not contain an AGREE annex subclause.");
    }
    final AgreeProgram agreeProgram = new AgreeASTBuilder().getAgreeProgram(systemInstance, type.isMonolithic());
    final SimulationProgram simulationProgram = AgreeProgramToSimulationProgram.transform(agreeProgram, type);
    final Simulation simulation = new Simulation(simulationProgram);
    return new AGREESimulationEngine(simulation, systemInstance, exceptionHandler);
}
Also used : AgreeProgramToSimulationProgram(edu.uah.rsesc.aadlsimulator.agree.transformation.AgreeProgramToSimulationProgram) SimulationProgram(edu.uah.rsesc.aadlsimulator.agree.SimulationProgram) ComponentType(org.osate.aadl2.ComponentType) Simulation(edu.uah.rsesc.aadlsimulator.agree.sim.Simulation) AgreeASTBuilder(com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram)

Example 10 with AgreeASTBuilder

use of com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder in project AGREE by loonwerks.

the class TcgLinkerFactory method wrapVerificationResult.

// Routines for actually building the verification results...
private void wrapVerificationResult(ComponentInstance si, CompositeAnalysisResult wrapper) {
    AgreeProgram agreeProgram = new AgreeASTBuilder().getAgreeProgram(si, monolithicAnalysis);
    Program program;
    program = LustreAstBuilder.getAssumeGuaranteeLustreProgram(agreeProgram);
    wrapper.addChild(createVerification("Contract Test Cases", si, program, agreeProgram));
}
Also used : Program(jkind.lustre.Program) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram) AgreeASTBuilder(com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder) AgreeProgram(com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram)

Aggregations

AgreeASTBuilder (com.rockwellcollins.atc.agree.analysis.ast.AgreeASTBuilder)10 AgreeProgram (com.rockwellcollins.atc.agree.analysis.ast.AgreeProgram)10 Program (jkind.lustre.Program)8 AgreeException (com.rockwellcollins.atc.agree.analysis.AgreeException)7 EphemeralImplementationUtil (com.rockwellcollins.atc.agree.analysis.EphemeralImplementationUtil)4 IStatus (org.eclipse.core.runtime.IStatus)4 Status (org.eclipse.core.runtime.Status)4 ComponentImplementation (org.osate.aadl2.ComponentImplementation)4 SystemInstance (org.osate.aadl2.instance.SystemInstance)4 AnalysisResult (jkind.api.results.AnalysisResult)3 CompositeAnalysisResult (jkind.api.results.CompositeAnalysisResult)3 IHandlerService (org.eclipse.ui.handlers.IHandlerService)3 ComponentType (org.osate.aadl2.ComponentType)3 Pair (org.eclipse.xtext.util.Pair)2 AnnexSubclause (org.osate.aadl2.AnnexSubclause)2 MATLABPrimaryFunction (com.rockwellcollins.atc.agree.codegen.ast.MATLABPrimaryFunction)1 SimulationProgram (edu.uah.rsesc.aadlsimulator.agree.SimulationProgram)1 Simulation (edu.uah.rsesc.aadlsimulator.agree.sim.Simulation)1 AgreeProgramToSimulationProgram (edu.uah.rsesc.aadlsimulator.agree.transformation.AgreeProgramToSimulationProgram)1 File (java.io.File)1