// replace substring
        private void replace_substr_const_const_Click(object sender, RoutedEventArgs e)
        {
            var f = new ReplaceSubstringDecorator
                        (new Const(cc_1.Text), new Const(cc_2.Text));

            f.Subformula = formula;
            formula      = f;

            formula_text.Content = string.Format("{0} @ ({1}, {2})",
                                                 formula_text.Content, cc_1.Text, cc_2.Text);
            cc_1.Text = "";
            cc_2.Text = "";
        }
        private void replace_substr_var_const_Click(object sender, RoutedEventArgs e)
        {
            if (vc_1.Text.Length == 0 || vc_1.Text.Contains(" "))
            {
                MessageBox.Show("Not valid variable name!");
                return;
            }

            var f = new ReplaceSubstringDecorator
                        (new Var(vc_1.Text), new Const(vc_2.Text));

            f.Subformula = formula;
            formula      = f;

            formula_text.Content = string.Format("{0} @ ({1}, {2})",
                                                 formula_text.Content, vc_1.Text, vc_2.Text);
            vc_1.Text = "";
            vc_2.Text = "";
        }