//-----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
//-----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using Microsoft.Boogie.VCExprAST;
namespace Microsoft.Boogie
{
///
/// The methods of this class are called in the following order:
/// DeclareType*
/// (DeclareConstant DeclareFunction)*
/// AddAxiom*
/// DeclareGlobalVariable*
/// At this time, all "attributes" are passed in as null.
///
[ContractClass(typeof(ProverContextContracts))]
public abstract class ProverContext : ICloneable {
protected virtual void ProcessDeclaration(Declaration decl) {Contract.Requires(decl != null);}
public virtual void DeclareType(TypeCtorDecl t, string attributes) {Contract.Requires(t != null); ProcessDeclaration(t); }
public virtual void DeclareConstant(Constant c, bool uniq, string attributes) {Contract.Requires(c != null); ProcessDeclaration(c); }
public virtual void DeclareFunction(Function f, string attributes) {Contract.Requires(f != null); ProcessDeclaration(f); }
public virtual void AddAxiom(Axiom a, string attributes) {Contract.Requires(a != null); ProcessDeclaration(a); }
public virtual void DeclareGlobalVariable(GlobalVariable v, string attributes) {Contract.Requires(v != null); ProcessDeclaration(v); }
public abstract void AddAxiom(VCExpr vc);
public abstract VCExpressionGenerator ExprGen { get; }
public abstract Boogie2VCExprTranslator BoogieExprTranslator { get; }
public abstract VCGenerationOptions VCGenOptions { get; }
public abstract object Clone();
}
[ContractClassFor(typeof(ProverContext))]
public class ProverContextContracts:ProverContext{
public override void AddAxiom(VCExpr vc) {
}
public override void AddAxiom(Axiom a, string attributes)
{
}
public override VCExpressionGenerator ExprGen
{
get { Contract.Ensures(Contract.Result() != null);
throw new NotImplementedException(); }
}
public override Boogie2VCExprTranslator BoogieExprTranslator
{
get { Contract.Ensures(Contract.Result() != null);
throw new NotImplementedException(); }
}
public override VCGenerationOptions VCGenOptions
{
get {Contract.Ensures(Contract.Result() != null);
throw new NotImplementedException(); }
}
public override object Clone()
{
Contract.Ensures(Contract.Result