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

Class Quantifier

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

Represents an abstract quantified expression of the form " forall(T v1, ... T vn).e " or " exists(T v1, ... T vn).e " where T1 v1 ... Tn vn are the quantified variable declarations and e is the body. @author David J. Pearce

Source from the content-addressed store, hash-verified

2999 *
3000 */
3001 public abstract static class Quantifier extends AbstractItem implements Expr, UnaryOperator {
3002 public Quantifier(int opcode, Decl.StaticVariable[] parameters, Expr body) {
3003 super(opcode, new Tuple<>(parameters), body);
3004 }
3005
3006 public Quantifier(int opcode, Tuple<Decl.StaticVariable> parameters, Expr body) {
3007 super(opcode, parameters, body);
3008 }
3009
3010 @Override
3011 public Type getType() {
3012 return Type.Bool;
3013 }
3014
3015 @Override
3016 public void setType(Type type) {
3017 if(!type.equals(Type.Bool)) {
3018 throw new IllegalArgumentException();
3019 }
3020 }
3021
3022 @SuppressWarnings("unchecked")
3023 public Tuple<Decl.StaticVariable> getParameters() {
3024 return (Tuple<Decl.StaticVariable>) get(0);
3025 }
3026
3027 @Override
3028 public Expr getOperand() {
3029 return (Expr) get(1);
3030 }
3031
3032 @Override
3033 public abstract Expr clone(Syntactic.Item[] operands);
3034 }
3035
3036 /**
3037 * Represents an unbounded universally quantified expression of the form

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected