MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / LogicalIff

Class LogicalIff

src/main/java/wyil/lang/WyilFile.java:3336–3379  ·  view source on GitHub ↗

Represents a logical biconditional of the form " e1 <==> e2 " where e1 and e2 are the operand expressions . @author David J. Pearce

Source from the content-addressed store, hash-verified

3334 *
3335 */
3336 public static class LogicalIff extends AbstractItem implements BinaryOperator {
3337 public LogicalIff(Expr lhs, Expr rhs) {
3338 super(EXPR_logicaliff, lhs, rhs);
3339 }
3340
3341 @Override
3342 public Type getType() {
3343 return Type.Bool;
3344 }
3345
3346 @Override
3347 public void setType(Type type) {
3348 if(!type.equals(Type.Bool)) {
3349 throw new IllegalArgumentException();
3350 }
3351 }
3352
3353 @Override
3354 public Expr getFirstOperand() {
3355 return (Expr) super.get(0);
3356 }
3357
3358 @Override
3359 public Expr getSecondOperand() {
3360 return (Expr) super.get(1);
3361 }
3362
3363 @Override
3364 public Expr clone(Syntactic.Item[] operands) {
3365 return new LogicalIff((Expr) operands[0], (Expr) operands[1]);
3366 }
3367
3368 @Override
3369 public String toString() {
3370 return " <==> ";
3371 }
3372
3373 public static final Descriptor DESCRIPTOR_0 = new Descriptor(Operands.TWO, Data.ZERO, "EXPR_logicaliff") {
3374 @Override
3375 public Syntactic.Item construct(int opcode, Syntactic.Item[] operands, byte[] data) {
3376 return new LogicalIff((Expr) operands[0], (Expr) operands[1]);
3377 }
3378 };
3379 }
3380
3381 /**
3382 * Represents a <i>logical negation</i> of the form "<code>!e</code>" where

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected