-- in.cue --
full: {
	kube: node: n1: {
		_CL: "l"
		_cs: (_CL): _a[(_CL)]
		_cs: (_CL): {
			opts: {}
		}
	}
	
	_a: "l": {
		_ba?: string
		opts: {
			if _ba != _|_ {b: (_ba)}
		}
	}
	
	for k, _ in _a & _b {
		x: 5
	}
	
	_a: [ID=_]: vms: [{ name: "hello" }]
	_b: [ID=_]: vms: [{ name: "again" }]
}
reduced: p1: {
	_cs: _a.l & {
		opts: {}
	}

	_a: l: {
		_ba?: string
		opts: {
			if _ba != _|_ {
				b: _ba
			}
		}
		vms: "hello"
	}
	
	_b: l: vms: "again"
	
	for k, _ in _a & _b {
		x: 5
	}
}
reduced: p2: {
	for k, _ in _a & _b {
		x: 5
	}

	_cs: _a.l & {
		opts: {}
	}

	_a: l: {
		_ba?: string
		opts: {
			if _ba != _|_ {
				b: _ba
			}
		}
		vms: "hello"
	}
	
	_b: l: vms: "again"
}
reference: {
	_x: {
		f: true
	}
	
	_y: {
		f: false
	}
	
	for k, _ in _x & _y {
		ok: true
	}
}
-- out/eval/stats --
Leaks:  4
Freed:  63
Reused: 55
Allocs: 12
Retain: 11

Unifications: 67
Conjuncts:    88
Disjuncts:    74
-- out/evalalpha --
(struct){
  full: (struct){
    kube: (struct){
      node: (struct){
        n1: (struct){
          _CL: (string){ "l" }
          _cs: (struct){
            l: (struct){
              opts: (struct){
              }
              _ba?: (string){ string }
              vms: (#list){
                0: (struct){
                  name: (string){ "hello" }
                }
              }
            }
          }
        }
      }
    }
    _a: (struct){
      l: (struct){
        _ba?: (string){ string }
        opts: (struct){
        }
        vms: (#list){
          0: (struct){
            name: (string){ "hello" }
          }
        }
      }
    }
    x: (int){ 5 }
    _b: (struct){
    }
  }
  reduced: (struct){
    p1: (struct){
      _cs: (struct){
        opts: (struct){
        }
        _ba?: (string){ string }
        vms: (string){ "hello" }
      }
      _a: (struct){
        l: (struct){
          _ba?: (string){ string }
          opts: (struct){
          }
          vms: (string){ "hello" }
        }
      }
      _b: (struct){
        l: (struct){
          vms: (string){ "again" }
        }
      }
      x: (int){ 5 }
    }
    p2: (struct){
      x: (int){ 5 }
      _cs: (struct){
        opts: (struct){
        }
        _ba?: (string){ string }
        vms: (string){ "hello" }
      }
      _a: (struct){
        l: (struct){
          _ba?: (string){ string }
          opts: (struct){
          }
          vms: (string){ "hello" }
        }
      }
      _b: (struct){
        l: (struct){
          vms: (string){ "again" }
        }
      }
    }
  }
  reference: (struct){
    _x: (struct){
      f: (bool){ true }
    }
    _y: (struct){
      f: (bool){ false }
    }
    ok: (bool){ true }
  }
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -6,9 +6,9 @@
           _CL: (string){ "l" }
           _cs: (struct){
             l: (struct){
-              _ba?: (string){ string }
               opts: (struct){
               }
+              _ba?: (string){ string }
               vms: (#list){
                 0: (struct){
                   name: (string){ "hello" }
@@ -38,9 +38,9 @@
   reduced: (struct){
     p1: (struct){
       _cs: (struct){
-        _ba?: (string){ string }
-        opts: (struct){
-        }
+        opts: (struct){
+        }
+        _ba?: (string){ string }
         vms: (string){ "hello" }
       }
       _a: (struct){
@@ -61,9 +61,9 @@
     p2: (struct){
       x: (int){ 5 }
       _cs: (struct){
-        _ba?: (string){ string }
-        opts: (struct){
-        }
+        opts: (struct){
+        }
+        _ba?: (string){ string }
         vms: (string){ "hello" }
       }
       _a: (struct){
-- out/eval --
(struct){
  full: (struct){
    kube: (struct){
      node: (struct){
        n1: (struct){
          _CL: (string){ "l" }
          _cs: (struct){
            l: (struct){
              _ba?: (string){ string }
              opts: (struct){
              }
              vms: (#list){
                0: (struct){
                  name: (string){ "hello" }
                }
              }
            }
          }
        }
      }
    }
    _a: (struct){
      l: (struct){
        _ba?: (string){ string }
        opts: (struct){
        }
        vms: (#list){
          0: (struct){
            name: (string){ "hello" }
          }
        }
      }
    }
    x: (int){ 5 }
    _b: (struct){
    }
  }
  reduced: (struct){
    p1: (struct){
      _cs: (struct){
        _ba?: (string){ string }
        opts: (struct){
        }
        vms: (string){ "hello" }
      }
      _a: (struct){
        l: (struct){
          _ba?: (string){ string }
          opts: (struct){
          }
          vms: (string){ "hello" }
        }
      }
      _b: (struct){
        l: (struct){
          vms: (string){ "again" }
        }
      }
      x: (int){ 5 }
    }
    p2: (struct){
      x: (int){ 5 }
      _cs: (struct){
        _ba?: (string){ string }
        opts: (struct){
        }
        vms: (string){ "hello" }
      }
      _a: (struct){
        l: (struct){
          _ba?: (string){ string }
          opts: (struct){
          }
          vms: (string){ "hello" }
        }
      }
      _b: (struct){
        l: (struct){
          vms: (string){ "again" }
        }
      }
    }
  }
  reference: (struct){
    _x: (struct){
      f: (bool){ true }
    }
    _y: (struct){
      f: (bool){ false }
    }
    ok: (bool){ true }
  }
}
-- out/compile --
--- in.cue
{
  full: {
    kube: {
      node: {
        n1: {
          _CL: "l"
          _cs: {
            〈1;_CL〉: 〈4;_a〉[〈1;_CL〉]
          }
          _cs: {
            〈1;_CL〉: {
              opts: {}
            }
          }
        }
      }
    }
    _a: {
      l: {
        _ba?: string
        opts: {
          if (〈1;_ba〉 != _|_(explicit error (_|_ literal) in source)) {
            b: 〈2;_ba〉
          }
        }
      }
    }
    for k, _ in (〈0;_a〉 & 〈0;_b〉) {
      x: 5
    }
    _a: {
      [_]: {
        vms: [
          {
            name: "hello"
          },
        ]
      }
    }
    _b: {
      [_]: {
        vms: [
          {
            name: "again"
          },
        ]
      }
    }
  }
  reduced: {
    p1: {
      _cs: (〈0;_a〉.l & {
        opts: {}
      })
      _a: {
        l: {
          _ba?: string
          opts: {
            if (〈1;_ba〉 != _|_(explicit error (_|_ literal) in source)) {
              b: 〈2;_ba〉
            }
          }
          vms: "hello"
        }
      }
      _b: {
        l: {
          vms: "again"
        }
      }
      for k, _ in (〈0;_a〉 & 〈0;_b〉) {
        x: 5
      }
    }
  }
  reduced: {
    p2: {
      for k, _ in (〈0;_a〉 & 〈0;_b〉) {
        x: 5
      }
      _cs: (〈0;_a〉.l & {
        opts: {}
      })
      _a: {
        l: {
          _ba?: string
          opts: {
            if (〈1;_ba〉 != _|_(explicit error (_|_ literal) in source)) {
              b: 〈2;_ba〉
            }
          }
          vms: "hello"
        }
      }
      _b: {
        l: {
          vms: "again"
        }
      }
    }
  }
  reference: {
    _x: {
      f: true
    }
    _y: {
      f: false
    }
    for k, _ in (〈0;_x〉 & 〈0;_y〉) {
      ok: true
    }
  }
}
