blob: 16416e11ed2d6b192a53b61daf6fcdcd80c99c56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Boogie;
using System.Diagnostics;
namespace GPUVerify
{
class CrossThreadInvariantProcessor : StandardVisitor
{
public override Expr VisitNAryExpr(NAryExpr node)
{
if (node.Fun is FunctionCall)
{
FunctionCall call = node.Fun as FunctionCall;
if (call.Func.Name.Equals("__uniform_bv32") || call.Func.Name.Equals("__uniform_bool"))
{
return Expr.Eq(new VariableDualiser(1).VisitExpr(node.Args[0].Clone() as Expr),
new VariableDualiser(2).VisitExpr(node.Args[0].Clone() as Expr));
}
if (call.Func.Name.Equals("__distinct_bv32") || call.Func.Name.Equals("__distinct_bool"))
{
return Expr.Neq(new VariableDualiser(1).VisitExpr(node.Args[0].Clone() as Expr),
new VariableDualiser(2).VisitExpr(node.Args[0].Clone() as Expr));
}
}
return base.VisitNAryExpr(node);
}
}
}
|