public override void Visit(ILogicalNot logicalNot) { base.Visit(logicalNot); Bpl.Expr exp = TranslatedExpressions.Pop(); TranslatedExpressions.Push(Bpl.Expr.Unary( logicalNot.Token(), Bpl.UnaryOperator.Opcode.Not, exp)); }
public override void TraverseChildren(ILogicalNot logicalNot) { base.Traverse(logicalNot.Operand); Bpl.Expr exp = TranslatedExpressions.Pop(); Bpl.Type operandType = this.sink.CciTypeToBoogie(logicalNot.Operand.Type); if (operandType == this.sink.Heap.RefType) { exp = Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Neq, exp, Bpl.Expr.Ident(this.sink.Heap.NullRef)); } else if (operandType == Bpl.Type.Int) { exp = Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Neq, exp, Bpl.Expr.Literal(0)); } else { //System.Diagnostics.Debug.Assert(operandType == Bpl.Type.Bool); } TranslatedExpressions.Push(Bpl.Expr.Unary( logicalNot.Token(), Bpl.UnaryOperator.Opcode.Not, exp)); }