blob: be6c89e50e680f3780ada0ce471497c88a333942 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2008 Peter Pasztor, Akos Horvath, Gergely Varro, Istvan Rath and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Peter Pasztor, Akos Horvath, Gergely Varro, Istvan Rath - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.gtasm.patternmatcher.patterns;
import java.util.Collection;
import org.eclipse.viatra2.gtasm.interpreter.exception.ViatraTransformationException;
import org.eclipse.viatra2.gtasm.interpreter.executionEnvironment.IExecutionEnvironment;
import org.eclipse.viatra2.gtasm.patternmatcher.IMatching;
import org.eclipse.viatra2.gtasm.patternmatcher.PatternCallSignature;
/**
* The runtime representation of a GT rule, which can execute gt rule
* application in an interpreted way. This interface is used by the ASM
* interpreter for performing gt rule application.
*
* @author Gergely Varro, Akos Horvath
*/
public interface IGTRuleMatcher {
/**
* Initialize the gtRule matcher with the actual invocation context
*
* @param actualEnviroment
* the Execution environment of the gt rule
* @throws ViatraTransformationException
*/
public void initGTRule(IExecutionEnvironment actualEnviroment)
throws ViatraTransformationException;
/**
* Returns the parameters of the rule after applying the rule.
*
* @param symSignatures
* The additional (e.g., containment) constraints of the input
* parameters
* @param symInputMapping
* The values of the input parameter mapping
* @return the values of the gt rule's parameters
* @throws ViatraTransformationException
*/
public Object[] match(PatternCallSignature[] symSignatures,
Object[] symInputMapping) throws ViatraTransformationException;
/**
* Returns all valid matchings of the LHS of the gt rule
*
* @param symSignatures
* The additional (e.g., containment) constraints of the input
* parameters
* @param symInputMapping
* The values of the input parameter mapping
* @param quantificationOrder
* @return The collection of the matchings
* @throws ViatraTransformationException
*/
public Collection<IMatching> initMatchAll(
PatternCallSignature[] symSignatures, Object[] symInputMapping,
Integer[] quantificationOrder) throws ViatraTransformationException;
/**
* Returns the parameters of the rule after applying the rule once!
*
* @param LHSMatching
* one matching of the LHS side
* @param symSignatures
* The additional (e.g., containment) constraints of the input
* parameters
* @param symInputMapping
* The values of the input parameter mapping
* @return the values of the gt rule's parameters
* @throws ViatraTransformationException
*/
public Object[] matchAll(IMatching LHSMatching,
PatternCallSignature[] symSignatures, Object[] symInputMapping)
throws ViatraTransformationException;
}