public Graph GenerateBAGraph(string assert) { if (AssertionDatabase.ContainsKey(assert)) { AssertionLTL ass = AssertionDatabase[assert] as AssertionLTL; if (ass != null) { Graph g = LTL2BA.AutomatonToDot(ass.BA); g.UserData = "!(" + ass.LTLString + ")"; return(g); } } return(null); }
private void Button_Generate_Click(object sender, System.EventArgs e) { try { EnableDisableUI(false); timer.Reset(); timer.Start(); BuchiAutomata BA = LTL2BA.FormulaToBA(TextBox_Prop.Text, options, new CommonToken(0, "")); timer.Stop(); gViewer.Graph = LTL2BA.AutomatonToDot(BA); gViewer.AutoSize = true; //this.StatusLabel_Status.Text = "Büchi Automata Generated with " + (gViewer.Graph.NodeCount - 1) + " Nodes " + (gViewer.Graph.EdgeCount - 1) + " Edges (checked in " + timer.Elapsed.TotalSeconds + "s)."; this.StatusLabel_Status.Text = string.Format(Resources.Büchi_Automata_Generated_with__0__Nodes__1__Edges__checked_in__2__s__, (gViewer.Graph.NodeCount - 1), (gViewer.Graph.EdgeCount - 1), timer.Elapsed.TotalSeconds); this.StatusLabel_Status.Tag = timer.Elapsed.TotalSeconds; timer.Reset(); timer.Start(); bool islive = LivenessChecking.isLiveness(BA); timer.Stop(); this.Label_IsSafety.Tag = timer.Elapsed.TotalSeconds; if (!islive) { this.Label_IsSafety.Text = string.Format(Resources.The_formula_is_a_safety_property__checked_in__0__s__, timer.Elapsed.TotalSeconds); } if (this.TextBox_Prop.Items.Contains(TextBox_Prop.Text)) { this.TextBox_Prop.Items.Add(TextBox_Prop.Text); } StatusLabel_Accept.Visible = true; } catch (Exception ex) { MessageBox.Show(Resources.The_input_LTL_is_not_correct__ + ex.Message, PAT.Common.Ultility.Ultility.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error); } EnableDisableUI(true); }