#name: bounds
#evalPartial
-- in.cue --
i1: >1 & 5
i2: (>=0 & <=10) & 5
i3: !=null & []
i4: !=2 & !=4

s1: >=0 & <=10 & !=1  // no simplification
s2: >=0 & <=10 & !=11 // >=0 & <=10
s3: >5 & !=5          // >5
s4: <10 & !=10        // <10
s5: !=2 & !=2

// TODO: could change inequality
s6: !=2 & >=2
s7: >=2 & !=2

s8: !=5 & >5

s10: >=0 & <=10 & <12 & >1 // >1  & <=10
s11: >0 & >=0 & <=12 & <12 // >0  & <12

s20: >=10 & <=10 // 10

s22:  >5 & <=6         // no simplification
s22a: >5 & (<=6 & int) // 6
s22b: (int & >5) & <=6 // 6
s22c: >=5 & (<6 & int) // 5
s22d: (int & >=5) & <6 // 5
s22e: (>=5 & <6) & int // 5
s22f: int & (>=5 & <6) // 5

s23:  >0 & <2         // no simplification
s23a: (>0 & <2) & int // int & 1
s23b: int & (>0 & <2) // int & 1
s23c: (int & >0) & <2 // int & 1
s23d: >0 & (int & <2) // int & 1
s23e: >0.0 & <2.0     // no simplification

s30: >0 & int

floats: {
	[string]: float
	f1:       <10.0 & <=5.0
	f2:       <=10.0 & <5.0
	f3:       <1.1 & <=1.1
	f4:       <=1.1 & <=1.1
	f5:       >1.1 & >=1.1
	f6:       >=1.1 & >1.1
	f7:       >=1.1 & <=1.1

	issue1310: >=2.1 & <=1.0
	fe2:       >2.1 & <=2.1

	fe3: float & >2 & <=3
}

e1: null & !=null
e2: !=null & null
e3: >1 & 1
e4: <0 & 0
e5: >1 & <0
e6: >11 & <11
e7: >=11 & <11
e8: >11 & <=11
e9: >"a" & <1
-- out/def --
i1: 5
i2: 5
i3: []
i4: !=2 & !=4
s1: >=0 & <=10 & !=1
s2: >=0 & <=10
s3: >5
s4: <10
s5: !=2

// TODO: could change inequality
s6:   !=2
s7:   !=2
s8:   >5
s10:  >1 & <=10
s11:  >0 & <12
s20:  10
s22:  >5 & <=6
s22a: 6
s22b: 6
s22c: 5
s22d: 5
s22e: 5
s22f: 5
s23:  >0 & <2
s23a: 1
s23b: 1
s23c: 1
s23d: 1
s23e: >0.0 & <2.0
s30:  >0
e1:   _|_ // invalid value null (excluded by !=null)
e2:   _|_ // invalid value null (excluded by !=null)
e3:   _|_ // invalid value 1 (out of bound >1)
e4:   _|_ // invalid value 0 (out of bound <0)
e5:   _|_ // conflicting bounds >1 and <0
e6:   _|_ // conflicting bounds >11 and <11
e7:   _|_ // conflicting bounds >=11 and <11
e8:   _|_ // conflicting bounds >11 and <=11
e9:   _|_ // conflicting values >"a" and <1 (mismatched types string and number)
-- out/legacy-debug --
<0>{i1: 5, i2: 5, i3: [], i4: (!=2 & !=4), s1: (>=0 & <=10 & !=1), s2: (>=0 & <=10), s3: >5, s4: <10, s5: !=2, s6: (!=2 & >=2), s7: (>=2 & !=2), s8: >5, s10: (<=10 & >1), s11: (>0 & <12), s20: 10, s22: (>5 & <=6), s22a: 6, s22b: 6, s22c: 5, s22d: 5, s22e: 5, s22f: 5, s23: (>0 & <2), s23a: 1, s23b: 1, s23c: 1, s23d: 1, s23e: (>0.0 & <2.0), s30: int & >0, e1: _|_((!=null & null):invalid value null (excluded by !=null)), e2: _|_((!=null & null):invalid value null (excluded by !=null)), e3: _|_((>1 & 1):invalid value 1 (out of bound >1)), e4: _|_((<0 & 0):invalid value 0 (out of bound <0)), e5: _|_(conflicting bounds >1 and <0), e6: _|_(conflicting bounds >11 and <11), e7: _|_(conflicting bounds >=11 and <11), e8: _|_(conflicting bounds >11 and <=11), e9: _|_((>"a" & <1):conflicting values >"a" and <1 (mismatched types string and number))}
-- out/compile --
--- in.cue
{
  i1: (>1 & 5)
  i2: ((>=0 & <=10) & 5)
  i3: (!=null & [])
  i4: (!=2 & !=4)
  s1: ((>=0 & <=10) & !=1)
  s2: ((>=0 & <=10) & !=11)
  s3: (>5 & !=5)
  s4: (<10 & !=10)
  s5: (!=2 & !=2)
  s6: (!=2 & >=2)
  s7: (>=2 & !=2)
  s8: (!=5 & >5)
  s10: (((>=0 & <=10) & <12) & >1)
  s11: (((>0 & >=0) & <=12) & <12)
  s20: (>=10 & <=10)
  s22: (>5 & <=6)
  s22a: (>5 & (<=6 & int))
  s22b: ((int & >5) & <=6)
  s22c: (>=5 & (<6 & int))
  s22d: ((int & >=5) & <6)
  s22e: ((>=5 & <6) & int)
  s22f: (int & (>=5 & <6))
  s23: (>0 & <2)
  s23a: ((>0 & <2) & int)
  s23b: (int & (>0 & <2))
  s23c: ((int & >0) & <2)
  s23d: (>0 & (int & <2))
  s23e: (>0.0 & <2.0)
  s30: (>0 & int)
  floats: {
    [string]: float
    f1: (<10.0 & <=5.0)
    f2: (<=10.0 & <5.0)
    f3: (<1.1 & <=1.1)
    f4: (<=1.1 & <=1.1)
    f5: (>1.1 & >=1.1)
    f6: (>=1.1 & >1.1)
    f7: (>=1.1 & <=1.1)
    issue1310: (>=2.1 & <=1.0)
    fe2: (>2.1 & <=2.1)
    fe3: ((float & >2) & <=3)
  }
  e1: (null & !=null)
  e2: (!=null & null)
  e3: (>1 & 1)
  e4: (<0 & 0)
  e5: (>1 & <0)
  e6: (>11 & <11)
  e7: (>=11 & <11)
  e8: (>11 & <=11)
  e9: (>"a" & <1)
}
-- out/eval/stats --
Leaks:  0
Freed:  50
Reused: 47
Allocs: 3
Retain: 0

Unifications: 50
Conjuncts:    126
Disjuncts:    50
-- out/evalalpha --
Errors:
e1: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
    ./in.cue:56:5
    ./in.cue:56:12
e2: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
    ./in.cue:57:5
    ./in.cue:57:14
e9: conflicting values >"a" and <1 (mismatched types string and number):
    ./in.cue:64:5
    ./in.cue:64:12
floats.issue1310: incompatible number bounds <=1.0 and >=2.1:
    ./in.cue:50:21
    ./in.cue:50:13
floats.fe2: incompatible number bounds <=2.1 and >2.1:
    ./in.cue:51:20
    ./in.cue:51:13
e3: invalid value 1 (out of bound >1):
    ./in.cue:58:5
    ./in.cue:58:10
e4: invalid value 0 (out of bound <0):
    ./in.cue:59:5
    ./in.cue:59:10
e5: incompatible number bounds <0 and >1:
    ./in.cue:60:10
    ./in.cue:60:5
e6: incompatible number bounds <11 and >11:
    ./in.cue:61:11
    ./in.cue:61:5
e7: incompatible number bounds <11 and >=11:
    ./in.cue:62:12
    ./in.cue:62:5
e8: incompatible number bounds <=11 and >11:
    ./in.cue:63:11
    ./in.cue:63:5

Result:
(_|_){
  // [eval]
  i1: (int){ 5 }
  i2: (int){ 5 }
  i3: (#list){
  }
  i4: (number){ &(!=2, !=4) }
  s1: (number){ &(>=0, <=10, !=1) }
  s2: (number){ &(>=0, <=10) }
  s3: (number){ >5 }
  s4: (number){ <10 }
  s5: (number){ !=2 }
  s6: (number){ &(>=2, !=2) }
  s7: (number){ &(>=2, !=2) }
  s8: (number){ >5 }
  s10: (number){ &(>1, <=10) }
  s11: (number){ &(>0, <12) }
  s20: (number){ 10 }
  s22: (number){ &(>5, <=6) }
  s22a: (int){ 6 }
  s22b: (int){ 6 }
  s22c: (int){ 5 }
  s22d: (int){ 5 }
  s22e: (int){ 5 }
  s22f: (int){ 5 }
  s23: (number){ &(>0, <2) }
  s23a: (int){ 1 }
  s23b: (int){ 1 }
  s23c: (int){ 1 }
  s23d: (int){ 1 }
  s23e: (number){ &(>0.0, <2.0) }
  s30: (int){ &(>0, int) }
  floats: (_|_){
    // [eval]
    f1: (float){ &(<=5.0, float) }
    f2: (float){ &(<5.0, float) }
    f3: (float){ &(<1.1, float) }
    f4: (float){ &(<=1.1, float) }
    f5: (float){ &(>1.1, float) }
    f6: (float){ &(>1.1, float) }
    f7: (float){ 1.1 }
    issue1310: (_|_){
      // [eval] floats.issue1310: incompatible number bounds <=1.0 and >=2.1:
      //     ./in.cue:50:21
      //     ./in.cue:50:13
    }
    fe2: (_|_){
      // [eval] floats.fe2: incompatible number bounds <=2.1 and >2.1:
      //     ./in.cue:51:20
      //     ./in.cue:51:13
    }
    fe3: (float){ &(>2, <=3, float) }
  }
  e1: (_|_){
    // [eval] e1: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
    //     ./in.cue:56:5
    //     ./in.cue:56:12
  }
  e2: (_|_){
    // [eval] e2: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
    //     ./in.cue:57:5
    //     ./in.cue:57:14
  }
  e3: (_|_){
    // [eval] e3: invalid value 1 (out of bound >1):
    //     ./in.cue:58:5
    //     ./in.cue:58:10
  }
  e4: (_|_){
    // [eval] e4: invalid value 0 (out of bound <0):
    //     ./in.cue:59:5
    //     ./in.cue:59:10
  }
  e5: (_|_){
    // [eval] e5: incompatible number bounds <0 and >1:
    //     ./in.cue:60:10
    //     ./in.cue:60:5
  }
  e6: (_|_){
    // [eval] e6: incompatible number bounds <11 and >11:
    //     ./in.cue:61:11
    //     ./in.cue:61:5
  }
  e7: (_|_){
    // [eval] e7: incompatible number bounds <11 and >=11:
    //     ./in.cue:62:12
    //     ./in.cue:62:5
  }
  e8: (_|_){
    // [eval] e8: incompatible number bounds <=11 and >11:
    //     ./in.cue:63:11
    //     ./in.cue:63:5
  }
  e9: (_|_){
    // [eval] e9: conflicting values >"a" and <1 (mismatched types string and number):
    //     ./in.cue:64:5
    //     ./in.cue:64:12
  }
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -2,30 +2,18 @@
 e1: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
     ./in.cue:56:5
     ./in.cue:56:12
-e2: conflicting values !=null and null (mismatched types (bool|string|bytes|func|list|struct|number) and null):
+e2: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
     ./in.cue:57:5
     ./in.cue:57:14
-e5: incompatible number bounds <0 and >1:
-    ./in.cue:60:5
-    ./in.cue:60:10
-e6: incompatible number bounds <11 and >11:
-    ./in.cue:61:5
-    ./in.cue:61:11
-e7: incompatible number bounds <11 and >=11:
-    ./in.cue:62:5
-    ./in.cue:62:12
-e8: incompatible number bounds <=11 and >11:
-    ./in.cue:63:5
-    ./in.cue:63:11
 e9: conflicting values >"a" and <1 (mismatched types string and number):
     ./in.cue:64:5
     ./in.cue:64:12
-floats.fe2: incompatible number bounds <=2.1 and >2.1:
-    ./in.cue:51:13
-    ./in.cue:51:20
 floats.issue1310: incompatible number bounds <=1.0 and >=2.1:
-    ./in.cue:50:13
     ./in.cue:50:21
+    ./in.cue:50:13
+floats.fe2: incompatible number bounds <=2.1 and >2.1:
+    ./in.cue:51:20
+    ./in.cue:51:13
 e3: invalid value 1 (out of bound >1):
     ./in.cue:58:5
     ./in.cue:58:10
@@ -32,6 +20,18 @@
 e4: invalid value 0 (out of bound <0):
     ./in.cue:59:5
     ./in.cue:59:10
+e5: incompatible number bounds <0 and >1:
+    ./in.cue:60:10
+    ./in.cue:60:5
+e6: incompatible number bounds <11 and >11:
+    ./in.cue:61:11
+    ./in.cue:61:5
+e7: incompatible number bounds <11 and >=11:
+    ./in.cue:62:12
+    ./in.cue:62:5
+e8: incompatible number bounds <=11 and >11:
+    ./in.cue:63:11
+    ./in.cue:63:5
 
 Result:
 (_|_){
@@ -74,16 +74,16 @@
     f4: (float){ &(<=1.1, float) }
     f5: (float){ &(>1.1, float) }
     f6: (float){ &(>1.1, float) }
-    f7: (number){ 1.1 }
+    f7: (float){ 1.1 }
     issue1310: (_|_){
       // [eval] floats.issue1310: incompatible number bounds <=1.0 and >=2.1:
-      //     ./in.cue:50:13
       //     ./in.cue:50:21
+      //     ./in.cue:50:13
     }
     fe2: (_|_){
       // [eval] floats.fe2: incompatible number bounds <=2.1 and >2.1:
-      //     ./in.cue:51:13
       //     ./in.cue:51:20
+      //     ./in.cue:51:13
     }
     fe3: (float){ &(>2, <=3, float) }
   }
@@ -93,7 +93,7 @@
     //     ./in.cue:56:12
   }
   e2: (_|_){
-    // [eval] e2: conflicting values !=null and null (mismatched types (bool|string|bytes|func|list|struct|number) and null):
+    // [eval] e2: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
     //     ./in.cue:57:5
     //     ./in.cue:57:14
   }
@@ -109,23 +109,23 @@
   }
   e5: (_|_){
     // [eval] e5: incompatible number bounds <0 and >1:
-    //     ./in.cue:60:5
     //     ./in.cue:60:10
+    //     ./in.cue:60:5
   }
   e6: (_|_){
     // [eval] e6: incompatible number bounds <11 and >11:
-    //     ./in.cue:61:5
     //     ./in.cue:61:11
+    //     ./in.cue:61:5
   }
   e7: (_|_){
     // [eval] e7: incompatible number bounds <11 and >=11:
-    //     ./in.cue:62:5
     //     ./in.cue:62:12
+    //     ./in.cue:62:5
   }
   e8: (_|_){
     // [eval] e8: incompatible number bounds <=11 and >11:
-    //     ./in.cue:63:5
     //     ./in.cue:63:11
+    //     ./in.cue:63:5
   }
   e9: (_|_){
     // [eval] e9: conflicting values >"a" and <1 (mismatched types string and number):
-- diff/todo/p3 --
Reordering
-- diff/explanation --
f7 changed from number to float. This is a bug fix.
-- out/eval --
Errors:
e1: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
    ./in.cue:56:5
    ./in.cue:56:12
e2: conflicting values !=null and null (mismatched types (bool|string|bytes|func|list|struct|number) and null):
    ./in.cue:57:5
    ./in.cue:57:14
e5: incompatible number bounds <0 and >1:
    ./in.cue:60:5
    ./in.cue:60:10
e6: incompatible number bounds <11 and >11:
    ./in.cue:61:5
    ./in.cue:61:11
e7: incompatible number bounds <11 and >=11:
    ./in.cue:62:5
    ./in.cue:62:12
e8: incompatible number bounds <=11 and >11:
    ./in.cue:63:5
    ./in.cue:63:11
e9: conflicting values >"a" and <1 (mismatched types string and number):
    ./in.cue:64:5
    ./in.cue:64:12
floats.fe2: incompatible number bounds <=2.1 and >2.1:
    ./in.cue:51:13
    ./in.cue:51:20
floats.issue1310: incompatible number bounds <=1.0 and >=2.1:
    ./in.cue:50:13
    ./in.cue:50:21
e3: invalid value 1 (out of bound >1):
    ./in.cue:58:5
    ./in.cue:58:10
e4: invalid value 0 (out of bound <0):
    ./in.cue:59:5
    ./in.cue:59:10

Result:
(_|_){
  // [eval]
  i1: (int){ 5 }
  i2: (int){ 5 }
  i3: (#list){
  }
  i4: (number){ &(!=2, !=4) }
  s1: (number){ &(>=0, <=10, !=1) }
  s2: (number){ &(>=0, <=10) }
  s3: (number){ >5 }
  s4: (number){ <10 }
  s5: (number){ !=2 }
  s6: (number){ &(>=2, !=2) }
  s7: (number){ &(>=2, !=2) }
  s8: (number){ >5 }
  s10: (number){ &(>1, <=10) }
  s11: (number){ &(>0, <12) }
  s20: (number){ 10 }
  s22: (number){ &(>5, <=6) }
  s22a: (int){ 6 }
  s22b: (int){ 6 }
  s22c: (int){ 5 }
  s22d: (int){ 5 }
  s22e: (int){ 5 }
  s22f: (int){ 5 }
  s23: (number){ &(>0, <2) }
  s23a: (int){ 1 }
  s23b: (int){ 1 }
  s23c: (int){ 1 }
  s23d: (int){ 1 }
  s23e: (number){ &(>0.0, <2.0) }
  s30: (int){ &(>0, int) }
  floats: (_|_){
    // [eval]
    f1: (float){ &(<=5.0, float) }
    f2: (float){ &(<5.0, float) }
    f3: (float){ &(<1.1, float) }
    f4: (float){ &(<=1.1, float) }
    f5: (float){ &(>1.1, float) }
    f6: (float){ &(>1.1, float) }
    f7: (number){ 1.1 }
    issue1310: (_|_){
      // [eval] floats.issue1310: incompatible number bounds <=1.0 and >=2.1:
      //     ./in.cue:50:13
      //     ./in.cue:50:21
    }
    fe2: (_|_){
      // [eval] floats.fe2: incompatible number bounds <=2.1 and >2.1:
      //     ./in.cue:51:13
      //     ./in.cue:51:20
    }
    fe3: (float){ &(>2, <=3, float) }
  }
  e1: (_|_){
    // [eval] e1: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
    //     ./in.cue:56:5
    //     ./in.cue:56:12
  }
  e2: (_|_){
    // [eval] e2: conflicting values !=null and null (mismatched types (bool|string|bytes|func|list|struct|number) and null):
    //     ./in.cue:57:5
    //     ./in.cue:57:14
  }
  e3: (_|_){
    // [eval] e3: invalid value 1 (out of bound >1):
    //     ./in.cue:58:5
    //     ./in.cue:58:10
  }
  e4: (_|_){
    // [eval] e4: invalid value 0 (out of bound <0):
    //     ./in.cue:59:5
    //     ./in.cue:59:10
  }
  e5: (_|_){
    // [eval] e5: incompatible number bounds <0 and >1:
    //     ./in.cue:60:5
    //     ./in.cue:60:10
  }
  e6: (_|_){
    // [eval] e6: incompatible number bounds <11 and >11:
    //     ./in.cue:61:5
    //     ./in.cue:61:11
  }
  e7: (_|_){
    // [eval] e7: incompatible number bounds <11 and >=11:
    //     ./in.cue:62:5
    //     ./in.cue:62:12
  }
  e8: (_|_){
    // [eval] e8: incompatible number bounds <=11 and >11:
    //     ./in.cue:63:5
    //     ./in.cue:63:11
  }
  e9: (_|_){
    // [eval] e9: conflicting values >"a" and <1 (mismatched types string and number):
    //     ./in.cue:64:5
    //     ./in.cue:64:12
  }
}
