// CalcDefaultMainOperator.dfy

/*
module _System {
  /* CALL GRAPH for module _System:
   * SCC at height 2:
   *   RotateRight
   * SCC at height 1:
   *   RotateLeft
   * SCC at height 0:
   *   nat
   */
  type string(==) = seq<char>

  type {:axiom} nat(==) = x: int
    | 0 <= x

  trait {:compile false} object { }
  /*-- non-null type
  type {:axiom} object(==) = c: object? | c != null    /*special witness*/
  */

  class {:compile false} array<arg> {
    var Length: int  // immutable
  }
  /*-- non-null type
  type {:axiom} array(==)<arg> = c: array?<arg> | c != null    /*special witness*/
  */

  class {:compile false} /*_#Func0*/ () ~> +R {
    function requires(): bool
      reads reads()

    function reads(): set<object?>
      reads reads()
  }

  type {:compile false} /*_#PartialFunc0*/ () --> +R = f: () ~> R
    | f.reads() == {}
    /*special witness*/

  type {:compile false} /*_#TotalFunc0*/ () -> +R = f: () --> R
    | f.requires()
    /*special witness*/

  datatype {:compile false} /*_tuple#2*/ (+T0, +T1) = _#Make2(0: T0, 1: T1)

  class {:compile false} /*_#Func1*/ -T0 ~> +R {
    function requires(x0: T0): bool
      reads reads(x0)

    function reads(x0: T0): set<object?>
      reads reads(x0)
  }

  type {:compile false} /*_#PartialFunc1*/ -T0 --> +R = f: T0 ~> R
    | forall x0: T0 :: f.reads(x0) == {}
    /*special witness*/

  type {:compile false} /*_#TotalFunc1*/ -T0 -> +R = f: T0 --> R
    | forall x0: T0 :: f.requires(x0)
    /*special witness*/

  type bool { }

  type int { }

  type real {
    var Floor: int  // immutable
  }

  type ORDINAL {
    var IsLimit: bool  // immutable
    var IsSucc: bool  // immutable
    var Offset: int  // immutable
    var IsNat: bool  // immutable
  }

  type bv {
    function method RotateLeft(w: nat): selftype

    function method RotateRight(w: nat): selftype
  }

  type map<T, U> {
    var Keys: set<T>  // immutable
    var Values: set<U>  // immutable
    var Items: set<(T, U)>  // immutable
  }

  type imap<T, U> {
    var Keys: iset<T>  // immutable
    var Values: iset<U>  // immutable
    var Items: iset<(T, U)>  // immutable
  }

  datatype /*_tuple#0*/ () = _#Make0
}
// bitvector types in use:
*/

/* CALL GRAPH for module _module:
 * SCC at height 2:
 *   TestMultiset
 * SCC at height 1:
 *   TestSet
 * SCC at height 0:
 *   TestBool
 */
lemma TestBool(F: bool, T: bool)
  requires F == false && T == true
  decreases F, T
{
  calc <== {
    false;
  <==
    T;
  <==
    F;
  }
  calc ==> {
    true;
  ==>
    F;
  ==>
    T;
  }
  calc ==> {
    F;
  ==>
    T;
  ==>
    false;
  }
  calc <== {
    false;
  <==
    T;
  <==
    F;
  }
}

lemma TestSet(Empty: set<int>, Nonempty: set<int>)
  requires |Empty| == 0 && |Nonempty| > 0
  decreases Empty, Nonempty
{
  calc >= {
    {};
  >=
    Nonempty;
  >=
    Empty;
  }
  calc <= {
    Empty;
  <=
    Nonempty;
  <=
    {};
  }
}

lemma TestMultiset(Empty: multiset<int>, Nonempty: multiset<int>)
  requires |Empty| == 0 && |Nonempty| > 0
  decreases Empty, Nonempty
{
  calc >= {
    multiset{};
  >=
    Nonempty;
  >=
    Empty;
  }
  calc <= {
    Empty;
  <=
    Nonempty;
  <=
    multiset{};
  }
}
CalcDefaultMainOperator.dfy(9,4): Error: the calculation step between the previous line and this line might not hold
Execution trace:
    (0,0): anon0
    (0,0): anon18_Then
CalcDefaultMainOperator.dfy(14,4): Error: the calculation step between the previous line and this line might not hold
Execution trace:
    (0,0): anon0
    CalcDefaultMainOperator.dfy(7,3): anon19_Else
    (0,0): anon21_Then
CalcDefaultMainOperator.dfy(20,4): Error: the calculation step between the previous line and this line might not hold
Execution trace:
    (0,0): anon0
    CalcDefaultMainOperator.dfy(7,3): anon19_Else
    CalcDefaultMainOperator.dfy(12,3): anon22_Else
    (0,0): anon25_Then
CalcDefaultMainOperator.dfy(24,4): Error: the calculation step between the previous line and this line might not hold
Execution trace:
    (0,0): anon0
    CalcDefaultMainOperator.dfy(7,3): anon19_Else
    CalcDefaultMainOperator.dfy(12,3): anon22_Else
    CalcDefaultMainOperator.dfy(17,3): anon25_Else
    (0,0): anon27_Then
CalcDefaultMainOperator.dfy(34,4): Error: the calculation step between the previous line and this line might not hold
Execution trace:
    (0,0): anon0
    (0,0): anon10_Then
CalcDefaultMainOperator.dfy(40,4): Error: the calculation step between the previous line and this line might not hold
Execution trace:
    (0,0): anon0
    CalcDefaultMainOperator.dfy(32,3): anon11_Else
    (0,0): anon14_Then
CalcDefaultMainOperator.dfy(49,4): Error: the calculation step between the previous line and this line might not hold
Execution trace:
    (0,0): anon0
    (0,0): anon10_Then
CalcDefaultMainOperator.dfy(55,4): Error: the calculation step between the previous line and this line might not hold
Execution trace:
    (0,0): anon0
    CalcDefaultMainOperator.dfy(47,3): anon11_Else
    (0,0): anon14_Then

Dafny program verifier finished with 0 verified, 8 errors
