LinkedList <ITlaState> MakeResult(TlaAutomaton automaton, PathItem path, PathItem cycle) { var xg = automaton.ToXmlGraph(); this.LastVerificationGraphInfo = xg; if (path != null) { for (var item = cycle; item != null; item = item.Prev) { xg[item.State.Name].Background = "Blue"; if (item.FromTransition != null) { xg[item.FromTransition.FromState.Name].GetConnectionTargets().First(l => l.Target.Id == item.FromTransition.ToState.Name).Color = "Blue"; } } var list = new LinkedList <ITlaState>(); for (var item = path; item != null; item = item.Prev) { xg[item.State.Name].Background = "Green"; list.AddFirst(item.State); if (item.FromTransition != null) { xg[item.FromTransition.FromState.Name].GetConnectionTargets().First(l => l.Target.Id == item.FromTransition.ToState.Name).Color = "Green"; } } return(list); } else { return(null); } }
public static void SaveAsDgmlGraph(this TlaAutomaton automaton, string fileName) { automaton.ToXmlGraph().MakeXmlDocument().Save(fileName); }