// RUN: %boogie -noVerify "%s" > "%t" // RUN: %diff "%s.expect" "%t" function F( [b]a ) returns (bool); const M: [ [b]a ] bool; procedure P() { var f: [c]c; var b: bool; b := F(f); // type error b := M[f]; // type error b := (forall g: [c]c :: F(g)); // type error b := (forall g: [c]c :: M[g]); // type error } type Field a; axiom (exists x:[Field c]a, y:[Field d]d :: x == y); // error: not unifiable axiom (forall x:[Field c]a, y:[Field d]d :: x == y); // error: not unifiable procedure Uhu(x: [Field c]a, y: [Field d]d); procedure Oyeah(t: T) { var xx: [Field cc]T; var yy:
[Field dd]dd; var zz: [Field T]ee; call Uhu(xx, yy); call Uhu(yy, yy); // type error in argument 0 call Uhu(xx, xx); // type error in argument 1 assert xx == yy; // error: not unifiable assert yy == xx; // error: not unifiable call Uhu(xx, zz); // type error in argument 1 } procedure Jitters() { var x: [a,a]int; var y: [b,int]int; var z: [int,c]int; assert x == y; // error: not unifiable assert y == z; // error: not unifiable assert x == z; // error: not unifiable } procedure Nuther() { var x: [a,a,b]int; var y: [a,b,b]int; assert x == y; // error: not unifiable } type NagainCtor a; procedure Nagain() requires (forall x: a, y: b :: x == y); ensures (forall x: a, y: Field b, z: NagainCtor b :: x == y && x == z); ensures (forall y: Field b, z: NagainCtor b :: y == z); // error: types not unifiable { }