public ConfigurationGraphBuilder(bool compareParameterizedSystem, bool matchProcessParameters)
        {
            this.compareParameterizedSystem = compareParameterizedSystem;

            this.matchProcessParameters = matchProcessParameters;

            //this.compareSameSpec = ?? set true if compare models of same spec

            initialize();

            this.removedIsolatedNodes = false;

            diff = new PAT.GenericDiff.diff.GenericDiff(
                diffParameters.compatibleTypes,
                diffParameters.mappingWeights,
                diffParameters.distanceThresholdVectors,
                diffParameters.epsilonEdgesExcluded,
                diffParameters.maxIteration,
                diffParameters.noPairupIdenticalNodesWithOthers,
                diffParameters.stepsOfNeighbors,
                diffParameters.stopGreedySearchThreshold,
                diffParameters.stopPropagationThreshold,
                diffParameters.removeOutliersThreshold,
                diffParameters.considerNodeDistance,
                diffParameters.considerEdgeDistance,
                diffParameters.includeUnmatched,
                diffParameters.includeNeighbors,
                diffParameters.conductCandidatesSearch,
                diffParameters.appendEpsilonPairups,
                diffParameters.doGreedySearch,
                diffParameters.compareAdditionalInfo,
                diffParameters.notMaximalBipartiteMatch,
                diffParameters.searchPotentialCandidatesKind,
                diffParameters.neighborhoodMatchingStrategyKind,
                diffParameters.removeOutliersStrtegyKind,
                diffParameters.matchingStrategyKind,
                null);
        }
        /* todo: xingzc.
         *
         * Need GlobalVar info to initialze nodeInfoTemplates/nodeInfoNone/nodeInfoCalculatorKind
         *
         * Need to know if left/right is parameterized system and cutnumber. This affects initialize() and Parser.
         * For parameterized system, no need to get a subgraph from a Configuration. A counter vector will be ok.
         * Probably we can still obtain a subgraph. But do not need to compare subgraphs. Instead, extract a counter
         * vector from the subgraph and use it to represent the state info.
         */
        public List <PairUpCandidate> execute(Graph left, Graph right, List <string> vars, bool notMaximalBipartite, SpecificationBase leftSpec, SpecificationBase rightSpec, bool eventDetails, bool matchProcessParameters, bool matchStateStructure, bool matchIfGuardCondition)
        {
            if (left.UserData != null)
            {
                this.cutnumber1 = (int)left.UserData;
            }
            if (right.UserData != null)
            {
                this.cutnumber2 = (int)right.UserData;
            }
            this.compareParameterizedSystem = (this.cutnumber1 != -1) && (this.cutnumber2 != -1);

            this.compareConfigGraph = compareConfigGraph && !compareParameterizedSystem;

            this.notMaximalBipartiteMatch = notMaximalBipartite;

            this.matchEventDetails = eventDetails;

            //ly; newly added.
            this.compareConfigGraph = matchStateStructure;
            //todo: matchIfGuardCondition needs to be added.

            List <string> primitiveVariables = new List <string>();

            Valuation leftValuation = leftSpec.GetEnvironment();

            foreach (string varName in vars)
            {
                if (leftValuation != null && leftValuation.Variables != null)
                {
                    ExpressionValue value = leftValuation.Variables.GetContainsKey(varName);
                    if (value is RecordValue)
                    {
                        RecordValue   array = value as RecordValue;
                        List <string> names = new List <string>();
                        for (int i = 0; i < array.Associations.Length; i++)
                        {
                            names.Add(varName);
                        }
                        selectedVariables.Add(names.ToArray());
                        vectorLength.Add(array.Associations.Length); // array length
                    }
                    else if (false)
                    {
                        // todo: xingzc. processing other complex data type
                    }
                    else // primitive types
                    {
                        primitiveVariables.Add(varName);
                    }
                }

                /* now assume variables of left/right graphs are the same and variables of all the nodes are the same
                 * thus, no need to do this
                 */
                /*if (rightValuation != null && rightValuation.Variables != null)
                 * {
                 *  ExpressionValue value = rightValuation.Variables.GetContainsKey(varName);
                 *  if (value is RecordValue)
                 *  {
                 *      selectedVariables.Add(new string[] {varName});
                 *      //vectorsLength.Add((value as RecordValue).Associations.Length); // array length
                 *  }
                 *  else if (false)
                 *  {
                 *      // todo: xingzc. processing other complex data type
                 *  }
                 *  else // primitive types
                 *  {
                 *      primitiveVariables.Add(varName);
                 *  }
                 * }*/
            }

            if (primitiveVariables.Count > 0)
            {
                selectedVariables.Add(primitiveVariables.ToArray());
                vectorLength.Add(primitiveVariables.Count);
            }

            initialize();

            PAT.GenericDiff.diff.GenericDiff diff = new PAT.GenericDiff.diff.GenericDiff(
                diffParameters.compatibleTypes,
                diffParameters.mappingWeights,
                diffParameters.distanceThresholdVectors,
                diffParameters.epsilonEdgesExcluded,
                diffParameters.maxIteration,
                diffParameters.noPairupIdenticalNodesWithOthers,
                diffParameters.stepsOfNeighbors,
                diffParameters.stopGreedySearchThreshold,
                diffParameters.stopPropagationThreshold,
                diffParameters.removeOutliersThreshold,
                diffParameters.considerNodeDistance,
                diffParameters.considerEdgeDistance,
                diffParameters.includeUnmatched,
                diffParameters.includeNeighbors,
                diffParameters.conductCandidatesSearch,
                diffParameters.appendEpsilonPairups,
                diffParameters.doGreedySearch,
                diffParameters.compareAdditionalInfo,
                diffParameters.notMaximalBipartiteMatch,
                diffParameters.searchPotentialCandidatesKind,
                diffParameters.neighborhoodMatchingStrategyKind,
                diffParameters.removeOutliersStrtegyKind,
                diffParameters.matchingStrategyKind,
                null);

            leftSpec.GrabSharedDataLock();
            leftSpec.LockSharedData(true);
            PATModelFileParser modelParser1 = new PATModelFileParser(left, Side.LHS, compareParameterizedSystem, this.compareConfigGraph, matchProcessParameters, infinity, cutnumber1);

            PAT.GenericDiff.graph.Graph graphLeft = createGraph(Side.LHS, modelParser1, leftGraphDataConfigs, "leftgraph");
            leftSpec.UnLockSharedData();

            rightSpec.GrabSharedDataLock();
            rightSpec.LockSharedData(true);
            PATModelFileParser modelParser2 = new PATModelFileParser(right, Side.RHS, compareParameterizedSystem, this.compareConfigGraph, matchProcessParameters, infinity, cutnumber2);

            PAT.GenericDiff.graph.Graph graphRight = createGraph(Side.RHS, modelParser2, rightGraphDataConfigs, "rightgraph");
            rightSpec.UnLockSharedData();

            List <PairUpCandidate> matches = diff.compare(graphLeft, graphRight);

            return(matches);
        }