/// <summary> /// ARMC constructor. /// </summary> /// <param name="config">Configuration.</param> public ARMC(Config config) : this(SSA <SYMBOL> .Parse(config.InitFilePath), SSA <SYMBOL> .Parse(config.BadFilePath), config.TauFilePaths.Select(path => SST <SYMBOL> .Parse(path)).ToArray(), config) { }
public PredicateAbstraction(Config config, SSA <SYMBOL> init = null, SSA <SYMBOL> bad = null, SST <SYMBOL>[] taus = null) { var initPreds = new List <SSA <SYMBOL> >(); /* add Init? */ if (config.InitialPredicate == Config.InitPred.Init || config.InitialPredicate == Config.InitPred.Both) { initPreds.Add(init ?? SSA <SYMBOL> .Parse(config.InitFilePath)); } /* add Bad? */ if (config.InitialPredicate == Config.InitPred.Bad || config.InitialPredicate == Config.InitPred.Both) { initPreds.Add(bad ?? SSA <SYMBOL> .Parse(config.BadFilePath)); } /* add transducer domains and/or ranges? */ SST <SYMBOL>[] ssts = taus ?? config.TauFilePaths.Select(path => SST <SYMBOL> .Parse(path)).ToArray(); if (config.IncludeGuard) { foreach (SST <SYMBOL> sst in ssts) { initPreds.Add(sst.Domain()); } } if (config.IncludeAction) { foreach (SST <SYMBOL> sst in ssts) { initPreds.Add(sst.Range()); } } /* ensure that the automata contain no epsilon transitions and have disjunct sets of states */ predicateAutomata = new Set <SSA <SYMBOL> >(); int offset = 0; foreach (SSA <SYMBOL> pred in initPreds) { SSA <SYMBOL> normPred = pred.RemoveEpsilons().Normalize(offset); predicateAutomata.Add(normPred); offset += normPred.States.Count(); } forward = (config.LanguageDirection == Config.Direction.Forward); heuristic = config.Heuristic; ignoredLabels = new Set <int>(); // remains empty if no heuristic used }