summaryrefslogtreecommitdiff
path: root/Source/Provers/TPTP/TPTPLineariser.cs
diff options
context:
space:
mode:
authorGravatar MichalMoskal <unknown>2011-02-11 19:38:00 +0000
committerGravatar MichalMoskal <unknown>2011-02-11 19:38:00 +0000
commit4760c55b4a09e4b11039e9537371a98f657d7704 (patch)
tree088536468e33d19829d25a86c56f57b460c1d402 /Source/Provers/TPTP/TPTPLineariser.cs
parentafb3de0ebf0539a89f2073a74f76bd811bee06c0 (diff)
Add USE_PREDICATES option to TPTP and SMT provers
Diffstat (limited to 'Source/Provers/TPTP/TPTPLineariser.cs')
-rw-r--r--Source/Provers/TPTP/TPTPLineariser.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/Provers/TPTP/TPTPLineariser.cs b/Source/Provers/TPTP/TPTPLineariser.cs
index 78b87590..a35d43f0 100644
--- a/Source/Provers/TPTP/TPTPLineariser.cs
+++ b/Source/Provers/TPTP/TPTPLineariser.cs
@@ -53,13 +53,13 @@ void ObjectInvariant()
// Lineariser for expressions. The result (bool) is currently not used for anything
public class TPTPExprLineariser : IVCExprVisitor<bool, LineariserOptions/*!*/> {
- public static string ToString(VCExpr e, UniqueNamer namer) {
+ public static string ToString(VCExpr e, UniqueNamer namer, TPTPProverOptions opts) {
Contract.Requires(e != null);
Contract.Requires(namer != null);
Contract.Ensures(Contract.Result<string>() != null);
StringWriter sw = new StringWriter();
- TPTPExprLineariser lin = new TPTPExprLineariser (sw, namer);
+ TPTPExprLineariser lin = new TPTPExprLineariser (sw, namer, opts);
Contract.Assert(lin!=null);
lin.Linearise(e, LineariserOptions.Default);
return cce.NonNull(sw.ToString());
@@ -85,11 +85,13 @@ void ObjectInvariant()
} }
internal readonly UniqueNamer Namer;
+ internal readonly TPTPProverOptions Options;
- public TPTPExprLineariser(TextWriter wr, UniqueNamer namer) {
+ public TPTPExprLineariser(TextWriter wr, UniqueNamer namer, TPTPProverOptions opts) {
Contract.Requires(wr != null);Contract.Requires(namer != null);
this.wr = wr;
this.Namer = namer;
+ this.Options = opts;
}
public void Linearise(VCExpr expr, LineariserOptions options) {
@@ -724,8 +726,11 @@ void ObjectInvariant()
string printedName = ExprLineariser.Namer.GetName(op.Func, Lowercase(op.Func.Name));
Contract.Assert(printedName!=null);
- // arguments are always terms
- WriteApplicationTermOnly(printedName, node, options);
+ if (ExprLineariser.Options.UsePredicates && op.Func.OutParams[0].TypedIdent.Type.IsBool)
+ WriteApplication(printedName, node, options, true);
+ else
+ // arguments are always terms
+ WriteApplicationTermOnly(printedName, node, options);
return true;
}