Beispiel #1
0
 ///////////////////////////////////////////////////////////
 public QuantifiedTypeExpression(
     Microsoft.Boogie.QuantifierExpr boogieExpression,
     Logic.TypeQuantifier quantifier,
     Logic.TypeVariable variable,
     Terms.Term expression
     )
 {
     Debug.Assert(boogieExpression != null);
     this.boogieQTExpression = boogieExpression;
     this.quantifier         = quantifier;
     this.variable           = variable;
     this.expression         = expression;
 }
Beispiel #2
0
        ////////////////////////////////////////////////////////////////////////////////////
        //TODO:Check if we get functions here
        private Term makeExpression(QuantifierExpr qe, bool old)
        {
            Term e = null;

            {
                List <Logic.Variable> quantifiedVariables = new List <Logic.Variable>();
                foreach (Microsoft.Boogie.Variable bv in qe.Dummies)
                {
                    quantifiedVariables.Add(new Logic.Basic.Variable(bv.TypedIdent.Name));
                }
                foreach (var v in quantifiedVariables)
                {
                    boundVariables.Add(v.name, v);
                }
                e = makeExpression(qe.Body, old);
                foreach (var v in quantifiedVariables)
                {
                    boundVariables.Remove(v.name);
                }
            }


            {
                Logic.Quantifier q = makeQuantifier(qe.Kind);
                for (int i = qe.Dummies.Length - 1; i >= 0; i--)
                {
                    Microsoft.Boogie.Variable v = qe.Dummies[i];
                    Logic.Sort     ls           = new Logic.Boogie.BoogieSort(v.TypedIdent.Type);
                    Logic.Variable lv           = new Logic.Boogie.BoogieVariable(v);
                    e = new Boogie.QuantifiedExpression(qe, q, lv, ls, e);
                }
            }
            {
                Logic.TypeQuantifier tq = makeTypeQuantifier(qe.Kind);
                for (int i = qe.TypeParameters.Length - 1; i >= 0; i--)
                {
                    Microsoft.Boogie.TypeVariable btv = qe.TypeParameters[i];
                    Logic.TypeVariable            tv  = new Logic.Boogie.TypeVariable(btv);
                    e = new Boogie.QuantifiedTypeExpression(qe, tq, tv, e);
                }
            }
            return(e);
        }