text: import unittest
  
  from cozy.common import OrderedSet
  from cozy.solver import satisfy, valid, satisfiable, IncrementalSolver, ModelCachingSolver
  from cozy.typecheck import typecheck, retypecheck
  from cozy.target_syntax import *
  from cozy.structures.heaps import *
  from cozy.syntax_tools import pprint, equal, implies, mk_lambda, free_vars
  
  zero = ENum(0).with_type(TInt())
  one  = ENum(1).with_type(TInt())
  
  def check_encoding(e, require=T, **opts):
      v = fresh_var(e.type)
      m = satisfy(EAll([require, EEq(e, v)]), validate_model=True, **opts)
      assert m is not None
  
  class TestSolver(unittest.TestCase):
  
      def test_symbolic_tuple(self):
          b = EVar("b").with_type(BOOL)
          x = EVar("x").with_type(TTuple((INT, INT)))
          y = EVar("y").with_type(TTuple((INT, INT)))
          e = equal(ETupleGet(ECond(b, x, y), 0), one)
          assert retypecheck(e)
          check_encoding(e)
  
      def test_the_empty(self):
          x = EEmptyList().with_type(TBag(TInt()))
          assert satisfy(EBinOp(EUnaryOp("the", x).with_type(INT), "==", one).with_type(TBool())) is None
  
      def test_the1(self):
          x = ESingleton(zero).with_type(TBag(TInt()))
          assert satisfy(EBinOp(EUnaryOp("the", x).with_type(INT), "==", zero).with_type(TBool())) is not None
          assert satisfy(EBinOp(EUnaryOp("the", x).with_type(INT), "==", one).with_type(TBool())) is None
  
      def test_the_acts_like_first(self):
          x = EBinOp(ESingleton(zero).with_type(TBag(TInt())), "+", ESingleton(one).with_type(TBag(TInt()))).with_type(TBag(TInt()))
          assert satisfy(EBinOp(EUnaryOp("the", x).with_type(INT), "==", zero).with_type(TBool())) is not None
          assert satisfy(EBinOp(EUnaryOp("the", x).with_type(INT), "==", one).with_type(TBool())) is None
  
      def test_the2(self):
          tgroup = TRecord((('name', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), ('groupList', TBag(TString())), ('members', TBag(TNative('org.xmpp.packet.JID'))), ('administrators', TBag(TNative('org.xmpp.packet.JID')))))
          groups = EVar('groups').with_type(TBag(THandle('groups', tgroup)))
          e = EUnaryOp('not', EBinOp(EUnaryOp('the', groups).with_type(THandle('groups', tgroup)), '==', EUnaryOp('the', EMap(EFilter(groups, ELambda(EVar('g').with_type(THandle('groups', tgroup)), EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('groups', tgroup)), 'val').with_type(tgroup), 'name').with_type(TString()), '==', EVar('name').with_type(TString())).with_type(TBool()))).with_type(TBag(THandle('groups', tgroup))), ELambda(EVar('g').with_type(THandle('groups', tgroup)), EVar('g').with_type(THandle('groups', tgroup)))).with_type(TBag(THandle('groups', tgroup)))).with_type(THandle('groups', tgroup))).with_type(TBool())).with_type(TBool())
          vars = [EVar('users').with_type(TBag(THandle('users', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))), EVar('rosterItems').with_type(TBag(THandle('rosterItems', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), groups, EVar('name').with_type(TString())]
          errs = typecheck(e, env={ v.id:v.type for v in vars })
          assert not errs
          assert satisfy(e, vars=vars, validate_model=True) is not None
  
      def test_empty_sum(self):
          x = EVar("x").with_type(TInt())
          model = satisfy(equal(x, EUnaryOp("sum", EEmptyList().with_type(TBag(TInt()))).with_type(INT)))
          assert model is not None
          assert model[x.id] == 0
  
      def test_symbolic_maps1(self):
          x = EVar("x").with_type(TMap(TInt(), TInt()))
          y = EVar("y").with_type(TMap(TInt(), TInt()))
          e = ENot(equal(x, y))
          check_encoding(e)
  
      def test_symbolic_maps2(self):
          x = EVar("x").with_type(TMap(TInt(), TInt()))
          e = ENot(equal(x, x))
          assert not satisfiable(e, validate_model=True)
  
      def test_symbolic_maps3(self):
          b = EVar("b").with_type(BOOL)
          x = EVar("x").with_type(TMap(INT, INT))
          y = EVar("y").with_type(TMap(INT, INT))
          z = EVar("z").with_type(INT)
          e = equal(EMapGet(ECond(b, x, y), z), z)
          assert retypecheck(e)
          check_encoding(e)
  
      def test_flatmap(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EUnaryOp('unique', EMap(EVar('ints').with_type(TBag(THandle('_HandleType12', TInt()))), ELambda(EVar('_var13').with_type(THandle('_HandleType12', TInt())), EGetField(EVar('_var13').with_type(THandle('_HandleType12', TInt())), 'val').with_type(TInt()))).with_type(TBag(TInt()))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('ints').with_type(TBag(THandle('_HandleType12', TInt())))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('unique', EFlatMap(EVar('ints').with_type(TBag(THandle('_HandleType12', TInt()))), ELambda(EVar('_var458').with_type(THandle('_HandleType12', TInt())), ESingleton(EVar('_var458').with_type(THandle('_HandleType12', TInt()))).with_type(TBag(THandle('_HandleType12', TInt()))))).with_type(TBag(THandle('_HandleType12', TInt())))).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=None, collection_depth=2, validate_model=True)
  
      def test_filter_true(self):
          xs = EVar("xs").with_type(TBag(THandle("X", INT)))
          e1 = EFilter(xs, mk_lambda(xs.type.t, lambda x: equal(EGetField(x, "val"), ENum(0).with_type(INT))))
          assert retypecheck(e1)
          e2 = EFilter(e1, mk_lambda(xs.type.t, lambda x: EBool(True)))
          assert retypecheck(e2)
          assert valid(equal(e1, e2))
  
      def test_make_record(self):
          t = TRecord((("f", INT), ("g", INT)))
          a = EVar("a").with_type(INT)
          b = EVar("b").with_type(INT)
          x = EMakeRecord((("f", a), ("g", b))).with_type(t)
          y = EMakeRecord((("f", b), ("g", a))).with_type(t)
          z = EMakeRecord((("g", b), ("f", a))).with_type(t)
          assert not valid(equal(x, y), validate_model=True)
          assert valid(equal(x, z), validate_model=True)
  
      def test_unary_minus(self):
          a = EVar("a").with_type(INT)
          check_encoding(ENot(equal(a, EUnaryOp("-", a).with_type(INT))))
  
      def test_distinct(self):
          a = EVar("a").with_type(TBag(INT))
          check_encoding(ENot(equal(a, EUnaryOp("distinct", a).with_type(TBag(INT)))))
  
      def test_unique_distinct(self):
          a = EVar("a").with_type(TBag(INT))
          assert valid(implies(EUnaryOp("unique", a).with_type(BOOL), equal(a, EUnaryOp("distinct", a).with_type(TBag(INT)))), validate_model=True)
  
      def test_distinct_of_empty(self):
          for t in (TSet, TBag, TList):
              e = EEmptyList().with_type(t(INT))
              x = EVar("x").with_type(e.type)
              check_encoding(EEq(x, EUnaryOp(UOp.Distinct, e).with_type(e.type)))
  
      def test_emap(self):
          e = EEq(
              EVar("xs").with_type(INT_BAG),
              EMap(EVar("ys").with_type(INT_BAG), mk_lambda(INT, lambda x: EBinOp(x, "+", ONE).with_type(INT))).with_type(INT_BAG))
          check_encoding(e)
  
      def test_map_keys_unique(self):
          a = EVar("a").with_type(TMap(INT, INT))
          e = EUnaryOp(UOp.AreUnique, EMapKeys(a).with_type(TBag(INT))).with_type(BOOL)
          assert valid(e, validate_model=True)
          check_encoding(e)
  
      def test_map_keys_distinct(self):
          a = EVar("a").with_type(TMap(INT, INT))
          e = equal(EMapKeys(a).with_type(TBag(INT)), EUnaryOp(UOp.Distinct, EMapKeys(a).with_type(TBag(INT))).with_type(TBag(INT)))
          assert valid(e, validate_model=True)
          check_encoding(e)
  
      def test_distinct_filter(self):
          a = EVar("a").with_type(TBag(INT))
          e = ENot(equal(EUnaryOp(UOp.Distinct, EFilter(a, mk_lambda(a.type.t, lambda x: equal(x, zero)))), EEmptyList().with_type(a.type)))
          assert retypecheck(e)
          check_encoding(e)
  
      def test_unary_all(self):
          a = EUnaryOp(UOp.All, EVar("a").with_type(TBag(BOOL)))
          assert retypecheck(a)
          check_encoding(a)
  
      def test_unary_any(self):
          a = EUnaryOp(UOp.Any, EVar("a").with_type(TBag(BOOL)))
          assert retypecheck(a)
          check_encoding(a)
  
      def test_symbolic_enum_left(self):
          T = TEnum(("A", "B"))
          x = EVar("x").with_type(T)
          e = equal(x, EEnumEntry("B").with_type(T))
          check_encoding(e)
  
      def test_symbolic_enum_right(self):
          T = TEnum(("A", "B"))
          x = EVar("x").with_type(T)
          e = equal(EEnumEntry("B").with_type(T), x)
          check_encoding(e)
  
      def test_enum_order(self):
          T = TEnum(("B", "A"))
          x = EVar("x").with_type(T)
          y = EVar("y").with_type(T)
          check_encoding(EBinOp(x, "<", y).with_type(BOOL))
  
      def test_bag_deep_equals(self):
          x = EVar("x").with_type(INT_BAG)
          y = EVar("y").with_type(INT_BAG)
          assert satisfiable(EAll((
              EEq(x, y),
              ENot(EBinOp(x, "===", y).with_type(BOOL)))), collection_depth=3, validate_model=True)
  
      def test_regression6(self):
          satisfy(EBinOp(EMakeMap2(EMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var44268').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EGetField(EGetField(EVar('_var44268').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t')))).with_type(TBag(TNative('uint64_t'))), ELambda(EVar('_var44256').with_type(TNative('uint64_t')), EFilter(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var44268').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EGetField(EGetField(EVar('_var44268').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t')), '==', EVar('_var44256').with_type(TNative('uint64_t'))).with_type(TBool()))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TMap(TNative('uint64_t'), TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))), '==', EMakeMap2(ESingleton(EVar('_var44256').with_type(TNative('uint64_t'))).with_type(TBag(TNative('uint64_t'))), ELambda(EVar('_var44256').with_type(TNative('uint64_t')), EEmptyList().with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TMap(TNative('uint64_t'), TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBool()), vars=OrderedSet([EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), EVar('_var44256').with_type(TNative('uint64_t'))]), collection_depth=2, validate_model=True)
  
      def test_regression7(self):
          satisfy(EBinOp(EMakeMap2(EMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var44268').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EGetField(EGetField(EVar('_var44268').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t')))).with_type(TBag(TNative('uint64_t'))), ELambda(EVar('_var44256').with_type(TNative('uint64_t')), EFilter(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var44268').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EGetField(EGetField(EVar('_var44268').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t')), '==', EVar('_var44256').with_type(TNative('uint64_t'))).with_type(TBool()))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TMap(TNative('uint64_t'), TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))), 'in', ESingleton(EMakeMap2(ESingleton(EVar('_var44256').with_type(TNative('uint64_t'))).with_type(TBag(TNative('uint64_t'))), ELambda(EVar('_var44256').with_type(TNative('uint64_t')), EEmptyList().with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TMap(TNative('uint64_t'), TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(TMap(TNative('uint64_t'), TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))))).with_type(TBool()), vars=OrderedSet([EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), EVar('_var44256').with_type(TNative('uint64_t'))]), collection_depth=2, validate_model=True)
  
      def test_regression8(self):
          satisfy(EBinOp(EUnaryOp('not', EBinOp(EVar('_var15871').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var15872').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool())).with_type(TBool()), 'and', ELet(EMakeMap2(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1315').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EMakeMap2(EFilter(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EGetField(EGetField(EVar('_var1315').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), '==', EEnumEntry('Disk').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))).with_type(TBool()))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EGetField(EGetField(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), ELambda(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EUnaryOp('not', EBinOp(EMapGet(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EVar('_var15871').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))), '==', EMapGet(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EVar('_var15872').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))).with_type(TBool())).with_type(TBool()))).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('_var15871').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EVar('_var15872').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))]), collection_depth=2, validate_model=True)
  
      def test_regression9(self):
          e = ELet(EMakeMap2(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1315').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EMakeMap2(EFilter(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EGetField(EGetField(EVar('_var1315').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), '==', EEnumEntry('Disk').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))).with_type(TBool()))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EGetField(EGetField(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), ELambda(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EUnaryOp('not', EBinOp(EMapGet(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EVar('_var15871').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))), '==', EMapGet(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EVar('_var15872').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))).with_type(TBool())).with_type(TBool()))).with_type(TBool())
          satisfy(e, collection_depth=2, validate_model=True)
  
      def test_regression10(self):
          e = ELet(EMakeMap2(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1315').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EMakeMap2(EFilter(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EGetField(EGetField(EVar('_var1315').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), '==', EEnumEntry('Disk').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))).with_type(TBool()))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EGetField(EGetField(EVar('_var1314').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), ELambda(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EUnaryOp('not', EBinOp(EMapGet(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EVar('_var15871').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))), '==', EMapGet(EVar('_var15873').with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))), EVar('_var15872').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))))).with_type(TBool())).with_type(TBool()))).with_type(TBool())
          satisfy(e.f.apply_to(e.e), collection_depth=2, validate_model=True)
  
      def test_regression11(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))), ELambda(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), EGetField(EGetField(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString()))).with_type(TBag(TString()))).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), ELambda(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'backendId').with_type(TLong()))).with_type(TBag(TLong()))).with_type(TBool()), 'and', EUnaryOp('unique', EMap(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'name').with_type(TString()))).with_type(TBag(TString()))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('empty', EFilter(EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))), ELambda(EVar('child').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), EUnaryOp('not', EBinOp(EGetField(EGetField(ETupleGet(EVar('child').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('ONLY_GROUP').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))))).with_type(TBool()), 'and', EBinOp(EUnaryOp('empty', EFilter(EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))), ELambda(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), EBinOp(EUnaryOp('not', EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), 1).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))))).with_type(TBool()), 'and', EUnaryOp('empty', EFilter(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), ELambda(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), EBinOp(EUnaryOp('not', EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 1).with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('empty', EFilter(EVar('admins').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), ELambda(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), EBinOp(EUnaryOp('not', EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 1).with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('admins').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TBool()), 'and', EUnaryOp('any', EMap(EFilter(EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))), ELambda(EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), EBinOp(EBinOp(EUnaryOp('not', EBinOp(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), '==', EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EFilter(EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), ELambda(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), EBinOp(EBinOp(ECall('jidToUsername', (EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'target').with_type(TNative('org.xmpp.packet.JID')),)).with_type(TString()), '==', EGetField(EGetField(EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString())).with_type(TBool()), 'and', EBinOp(EGetField(EGetField(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString()), '==', EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'user').with_type(TString())).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 'in', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool()), 'and', EBinOp(EBinOp(EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('EVERYBODY').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool()), 'or', EBinOp(EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('ONLY_GROUP').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool()), 'and', EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 'in', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('ONLY_GROUP').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool()), 'and', EUnaryOp('exists', EFilter(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('subg').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('subg').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), 'in', EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))))).with_type(TBool()), 'and', EUnaryOp('exists', EFilter(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), ELambda(EVar('t').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), EBinOp(EBinOp(ETupleGet(EVar('t').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), '==', EVar('subg').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBool()), 'and', EBinOp(ETupleGet(EVar('t').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 1).with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), '==', EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'name').with_type(TString()))).with_type(TBag(TString()))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EUnaryOp('not', EBinOp(EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), '==', EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EFilter(EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), ELambda(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), EBinOp(EBinOp(ECall('jidToUsername', (EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'target').with_type(TNative('org.xmpp.packet.JID')),)).with_type(TString()), '==', EGetField(EGetField(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString())).with_type(TBool()), 'and', EBinOp(EGetField(EGetField(EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString()), '==', EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'user').with_type(TString())).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 'in', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool()), 'and', EBinOp(EBinOp(EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('EVERYBODY').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool()), 'or', EBinOp(EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('ONLY_GROUP').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool()), 'and', EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 'in', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('ONLY_GROUP').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool()), 'and', EUnaryOp('exists', EFilter(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('subg').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('subg').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), 'in', EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))))).with_type(TBool()), 'and', EUnaryOp('exists', EFilter(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), ELambda(EVar('t').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), EBinOp(EBinOp(ETupleGet(EVar('t').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), '==', EVar('subg').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBool()), 'and', EBinOp(ETupleGet(EVar('t').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 1).with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), '==', EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'name').with_type(TString()))).with_type(TBag(TString()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))), ELambda(EVar('_fragarg').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), EBinOp(EVar('_fragarg').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), '===', EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EUnaryOp('len', EFilter(EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), ELambda(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), EBinOp(EBinOp(ECall('jidToUsername', (EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'target').with_type(TNative('org.xmpp.packet.JID')),)).with_type(TString()), '==', EGetField(EGetField(EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString())).with_type(TBool()), 'and', EBinOp(EGetField(EGetField(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString()), '==', EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'user').with_type(TString())).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))))).with_type(TInt()), '==', ENum(1).with_type(TInt())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('not', EUnaryOp('empty', EFilter(EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), ELambda(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), EBinOp(EBinOp(ECall('jidToUsername', (EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'target').with_type(TNative('org.xmpp.packet.JID')),)).with_type(TString()), '==', EGetField(EGetField(EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString())).with_type(TBool()), 'and', EBinOp(EGetField(EGetField(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString()), '==', EGetField(EGetField(EVar('i').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'user').with_type(TString())).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))), EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))), EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), EVar('admins').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), EVar('other').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))]), collection_depth=2, validate_model=True)
  
      def test_regression12(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))), ELambda(EVar('_var28803386').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), EGetField(EGetField(EVar('_var28803386').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'val').with_type(TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))), 'username').with_type(TString()))).with_type(TBag(TString()))).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), ELambda(EVar('_var28803404').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), EGetField(EGetField(EVar('_var28803404').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'backendId').with_type(TLong()))).with_type(TBag(TLong()))).with_type(TBool()), 'and', EUnaryOp('unique', EMap(EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), ELambda(EVar('_var28803404').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), ETuple((EGetField(EGetField(EVar('_var28803404').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'user').with_type(TString()), ECall('jidToUsername', (EGetField(EGetField(EVar('_var28803404').with_type(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType')))))), 'val').with_type(TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))), 'target').with_type(TNative('org.xmpp.packet.JID')),)).with_type(TString()))).with_type(TTuple((TString(), TString()))))).with_type(TBag(TTuple((TString(), TString()))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var28803469').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EGetField(EGetField(EVar('_var28803469').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'name').with_type(TString()))).with_type(TBag(TString()))).with_type(TBool()), 'and', EUnaryOp('empty', EFilter(EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))), ELambda(EVar('_var28803487').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), EUnaryOp('not', EBinOp(EGetField(EGetField(ETupleGet(EVar('_var28803487').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('ONLY_GROUP').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('empty', EFilter(EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))), ELambda(EVar('_var28803487').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), EBinOp(EUnaryOp('not', EBinOp(ETupleGet(EVar('_var28803487').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(ETupleGet(EVar('_var28803487').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), 1).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))))).with_type(TBool()), 'and', EUnaryOp('empty', EFilter(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), ELambda(EVar('_var28803539').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), EBinOp(EUnaryOp('not', EBinOp(ETupleGet(EVar('_var28803539').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(ETupleGet(EVar('_var28803539').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 1).with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('empty', EFilter(EVar('admins').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), ELambda(EVar('_var28803539').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), EBinOp(EUnaryOp('not', EBinOp(ETupleGet(EVar('_var28803539').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 0).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(ETupleGet(EVar('_var28803539').with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 1).with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('admins').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool()), 'and', EBinOp(EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TBool()), 'and', EUnaryOp('not', EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))), 'in', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('unique', EBinOp(EStateVar(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), '+', ESingleton(ETuple((EMapGet(EStateVar(EMakeMap2(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var28803469').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('_var28803469').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TMap(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TMap(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), EVar('_var28803469').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('users').with_type(TBag(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))), EVar('rosterItems').with_type(TBag(THandle('RosterItem', TRecord((('backendId', TLong()), ('user', TString()), ('target', TNative('org.xmpp.packet.JID')), ('nickname', TString()), ('askStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.AskType')), ('recvStatus', TNative('org.jivesoftware.openfire.roster.RosterItem.RecvType'))))))), EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), EVar('childGroups').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))), EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), EVar('admins').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date'))))))))), EVar('g').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('u').with_type(THandle('User', TRecord((('username', TString()), ('salt', TString()), ('storedKey', TString()), ('serverKey', TString()), ('iterations', TInt()), ('name', TString()), ('email', TString()), ('creationDate', TNative('java.util.Date')), ('modificationDate', TNative('java.util.Date')))))), EVar('_var28803469').with_type(THandle('Group', TRecord((('name', TString()), ('displayName', TString()), ('description', TString()), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))]), collection_depth=2, validate_model=True)
  
      def test_regression14(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EBinOp(EUnaryOp('unique', EVar('conns').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('reqs').with_type(TBag(THandle('Request', TRecord((('rq_time', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('GetConnectionCallback')))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('_var685').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_var690').with_type(TBag(THandle('Request', TRecord((('rq_time', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('GetConnectionCallback')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EMap(EVar('conns').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))), ELambda(EVar('_var534').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))), ECond(EBinOp(EVar('_var534').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))), '==', EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))).with_type(TBool()), EVar('_var534').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))), EVar('_var534').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))).with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))))).with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))), '==', EMap(EVar('_var685').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))), ELambda(EVar('_var534').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))), ECond(EBinOp(EVar('_var534').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))), '==', EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))).with_type(TBool()), EVar('_var534').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))), EVar('_var534').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))).with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))))).with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('conns').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))), EVar('reqs').with_type(TBag(THandle('Request', TRecord((('rq_time', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('GetConnectionCallback'))))))), EVar('_var685').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))), EVar('_var690').with_type(TBag(THandle('Request', TRecord((('rq_time', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('GetConnectionCallback'))))))), EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))), EVar('newstate').with_type(TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT')))]), collection_depth=2, validate_model=True)
  
      def test_regression15(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EBinOp(EUnaryOp('unique', EVar('conns').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('reqs').with_type(TBag(THandle('Request', TRecord((('rq_time', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('GetConnectionCallback')))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('_var685').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_var690').with_type(TBag(THandle('Request', TRecord((('rq_time', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('GetConnectionCallback')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EVar('conns').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))), '==', EVar('_var685').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('conns').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))), EVar('reqs').with_type(TBag(THandle('Request', TRecord((('rq_time', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('GetConnectionCallback'))))))), EVar('_var685').with_type(TList(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort'))))))), EVar('_var690').with_type(TBag(THandle('Request', TRecord((('rq_time', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('GetConnectionCallback'))))))), EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')))))), EVar('newstate').with_type(TEnum(('READY', 'PROCESSING', 'DROPPED', 'CHECKED_OUT')))]), collection_depth=2, validate_model=True)
  
      def test_regression16(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('tokens').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), ELambda(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), ETupleGet(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), 0).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('tokens').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('sum', EMap(EVar('tokens').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), ELambda(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), ENum(1).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '<', ENum(50).with_type(TInt())).with_type(TBool()), 'and', EUnaryOp('unique', EVar('tokens').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('_var860').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), ELambda(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), ETupleGet(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), 0).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_var860').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('sum', EMap(EVar('_var860').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), ELambda(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), ENum(1).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '<', ENum(50).with_type(TInt())).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_var860').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EBinOp(ECall('startOffset', (EVar('offsetAtt').with_type(TNative('OffsetAttribute')),)).with_type(TInt()), '>=', EArgMax(EMap(EFilter(EVar('tokens').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), ELambda(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), ECall('floatGtZero', (EGetField(ETupleGet(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), 1).with_type(TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))), 'score').with_type(TNative('Float')),)).with_type(TBool()))).with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), ELambda(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), EGetField(ETupleGet(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), 1).with_type(TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))), 'endOffset').with_type(TInt()))).with_type(TBag(TInt())), ELambda(EVar('_var550').with_type(TInt()), EVar('_var550').with_type(TInt()))).with_type(TInt())).with_type(TBool()), '==', EBinOp(ECall('startOffset', (EVar('_var861').with_type(TNative('OffsetAttribute')),)).with_type(TInt()), '>=', EArgMax(EMap(EFilter(EVar('_var860').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), ELambda(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), ECall('floatGtZero', (EGetField(ETupleGet(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), 1).with_type(TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))), 'score').with_type(TNative('Float')),)).with_type(TBool()))).with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), ELambda(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), EGetField(ETupleGet(EVar('_var563').with_type(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))))), 1).with_type(TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt())))), 'endOffset').with_type(TInt()))).with_type(TBag(TInt())), ELambda(EVar('_var550').with_type(TInt()), EVar('_var550').with_type(TInt()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('tokens').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), EVar('_var860').with_type(TBag(TTuple((TInt(), TRecord((('score', TNative('Float')), ('startOffset', TInt()), ('endOffset', TInt()))))))), EVar('offsetAtt').with_type(TNative('OffsetAttribute')), EVar('_var861').with_type(TNative('OffsetAttribute'))]), collection_depth=2, validate_model=True)
  
      def test_any_1(self):
          xs = EVar("xs").with_type(BOOL_BAG)
          e = EUnaryOp(UOp.Any, xs).with_type(BOOL)
          a = EEq(EUnaryOp(UOp.Length, xs).with_type(INT), ZERO)
          satisfy(EAll((a, e)), validate_model=True)
  
      def test_bag_subtraction1(self):
          xs = EVar("xs").with_type(TBag(INT))
          e = equal(EBinOp(xs, "-", xs), EEmptyList().with_type(xs.type))
          assert retypecheck(e)
          assert valid(e)
  
      def test_bag_subtraction2(self):
          xs = EVar("xs").with_type(TBag(INT))
          foo = EVar("foo").with_type(INT)
          e = equal(EBinOp(xs, "-", ESingleton(foo)), EEmptyList().with_type(xs.type))
          assert retypecheck(e)
          assert not valid(e, collection_depth=2)
  
      def test_str_literal_cmp(self):
          v = EVar("s").with_type(STRING)
          s = EStr("").with_type(STRING)
          assert not satisfiable(EBinOp(v, "<", s).with_type(BOOL))
          for op in ("==", "<=", ">", ">="):
              e = EBinOp(v, op, s).with_type(BOOL)
              model = satisfy(e)
              assert model is not None
              assert {
                  "==": model[v.id] == s.val,
                  ">" : model[v.id] >  s.val,
                  ">=": model[v.id] >= s.val,
                  "<" : model[v.id] <  s.val,
                  "<=": model[v.id] <= s.val,
                  }[op], "{} {} {}".format(repr(model[v.id]), op, repr(s.val))
  
      def test_map_default_value(self):
          xs = EVar("xs").with_type(TBag(INT))
          x = EVar("x").with_type(INT)
          m = EMakeMap2(xs, mk_lambda(INT, lambda y: y))
          e = EAll([
              equal(x, EMapGet(EMakeMap2(EEmptyList().with_type(xs.type), mk_lambda(INT, lambda y: y)), x)),
              EBinOp(x, BOp.In, xs),
              EBinOp(x, BOp.In, EMapKeys(m)),
              ])
          assert retypecheck(e)
          model = satisfy(e, validate_model=True)
          assert model
  
      def test_function_extraction01(self):
          x = EVar("x").with_type(INT)
          e = EEq(ECall("f", (x,)).with_type(INT), ZERO)
          model = satisfy(e)
          assert model
          assert model["f"](model["x"]) == 0
  
      def test_function_extraction02(self):
          x = EVar("x").with_type(TNative("Foo"))
          e = ECall("f", (x,)).with_type(TBool())
          model = satisfy(e)
          assert "x" in model
          assert "f" in model
          assert model["f"](model["x"]) is True
  
      def test_function_extraction03(self):
          x = EVar("x").with_type(TNative("Foo"))
          model = satisfy(EEq(x, x), funcs={ "f": TFunc((x.type,), BOOL) })
          assert "x" in model
          assert "f" in model
          assert model["f"](model["x"]) in (True, False)
  
      def test_function_extraction04(self):
          x = EVar("x").with_type(TNative("Foo"))
          model = satisfy(EEq(x, x), funcs={ "f": TFunc((), BOOL) })
          assert "x" in model
          assert "f" in model
          assert model["f"]() in (True, False)
  
      def test_function_extraction05(self):
          x = EVar("x").with_type(TNative("Foo"))
          e = ECall("f", ()).with_type(x.type)
          model = satisfy(EEq(x, e))
          assert "x" in model
          assert "f" in model
          assert model["f"](model["x"]) == model["x"]
  
      def test_argmin1(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBool(True).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EBinOp(EArgMin(EBinOp(EVar('xs').with_type(TBag(TInt())), '+', ESingleton(EVar('i').with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt())), ELambda(EVar('_var148').with_type(TInt()), EVar('_var148').with_type(TInt()))).with_type(TInt()), '+', EUnaryOp('-', EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var148').with_type(TInt()), EVar('_var148').with_type(TInt()))).with_type(TInt())).with_type(TInt())).with_type(TInt()), '==', EBinOp(EArgMin(EBinOp(EVar('_var164').with_type(TBag(TInt())), '+', ESingleton(EVar('i').with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt())), ELambda(EVar('_var148').with_type(TInt()), EVar('_var148').with_type(TInt()))).with_type(TInt()), '+', EUnaryOp('-', EArgMin(EVar('_var164').with_type(TBag(TInt())), ELambda(EVar('_var148').with_type(TInt()), EVar('_var148').with_type(TInt()))).with_type(TInt())).with_type(TInt())).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('xs').with_type(TBag(TInt())), EVar('i').with_type(TInt()), EVar('_var164').with_type(TBag(TInt()))]), collection_depth=2, validate_model=True)
  
      def test_argmin2(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBool(True).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EUnaryOp('not', EBinOp(EVar('_var70138').with_type(TInt()), 'in', EMapGet(EStateVar(EMakeMap2(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var41073').with_type(TInt()), ESingleton(EVar('_var41073').with_type(TInt())).with_type(TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt()))), EVar('i').with_type(TInt())).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EVar('_var70138').with_type(TInt()), 'in', EMapGet(EStateVar(EMakeMap2(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var41074').with_type(TInt()), ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var41073').with_type(TInt()), EVar('_var41074').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt()))), EVar('_var41073').with_type(TInt())).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('_var70138').with_type(TInt()), EVar('xs').with_type(TBag(TInt())), EVar('i').with_type(TInt()), EVar('_var41073').with_type(TInt())]), collection_depth=2, validate_model=True)
  
      def test_argmin3(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBool(True).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EUnaryOp('not', EBinOp(EVar('_var157969').with_type(TInt()), 'in', EMapGet(EStateVar(EMakeMap2(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var29812').with_type(TInt()), ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var29811').with_type(TInt()), EVar('_var29812').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt()))), EVar('_var29811').with_type(TInt())).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EVar('_var157969').with_type(TInt()), 'in', EMapGet(EStateVar(EMakeMap2(ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var29811').with_type(TInt()), EVar('_var29811').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())), ELambda(EVar('_var29812').with_type(TInt()), ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var29811').with_type(TInt()), EVar('_var29812').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt()))), EVar('_var29811').with_type(TInt())).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('_var157969').with_type(TInt()), EVar('xs').with_type(TBag(TInt())), EVar('_var29811').with_type(TInt())]), collection_depth=2, validate_model=True)
  
      def test_argmin4(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBool(True).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EUnaryOp('not', EBinOp(EVar('_var172384').with_type(TInt()), 'in', EMapGet(EStateVar(EMakeMap2(ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var9300').with_type(TInt()), EVar('_var9300').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())), ELambda(EVar('_var9301').with_type(TInt()), ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var9300').with_type(TInt()), EVar('_var9301').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt()))), EVar('_var9300').with_type(TInt())).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EVar('_var172384').with_type(TInt()), 'in', ECond(EBinOp(EVar('i').with_type(TInt()), '>', EArgMin(EMapGet(EStateVar(EMakeMap2(ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var9300').with_type(TInt()), EVar('_var9300').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())), ELambda(EVar('_var9301').with_type(TInt()), ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var9300').with_type(TInt()), EVar('_var9301').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt()))), EVar('_var9300').with_type(TInt())).with_type(TBag(TInt())), ELambda(EVar('_var9300').with_type(TInt()), EVar('_var9300').with_type(TInt()))).with_type(TInt())).with_type(TBool()), ESingleton(EArgMin(EMapGet(EStateVar(EMakeMap2(ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var9300').with_type(TInt()), EVar('_var9300').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())), ELambda(EVar('_var9301').with_type(TInt()), ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var9300').with_type(TInt()), EVar('_var9301').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt())))).with_type(TMap(TInt(), TBag(TInt()))), EVar('_var9300').with_type(TInt())).with_type(TBag(TInt())), ELambda(EVar('_var9300').with_type(TInt()), EVar('_var9300').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())), ESingleton(EVar('i').with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('_var172384').with_type(TInt()), EVar('xs').with_type(TBag(TInt())), EVar('_var9300').with_type(TInt()), EVar('i').with_type(TInt())]), collection_depth=2, validate_model=True)
  
      def test_argmin5(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBool(True).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EUnaryOp('not', EBinOp(EVar('_var16748').with_type(TInt()), 'in', EStateVar(ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var1021').with_type(TInt()), EVar('_var1021').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EVar('_var16748').with_type(TInt()), 'in', EVar('xs').with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('_var16748').with_type(TInt()), EVar('xs').with_type(TBag(TInt()))]), collection_depth=2, validate_model=True)
  
      def test_argmin6(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EBinOp(EUnaryOp('sum', EMap(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var32').with_type(TInt()), ENum(1).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '>=', ENum(2).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EUnaryOp('sum', EMap(EVar('_var66').with_type(TBag(TInt())), ELambda(EVar('_var32').with_type(TInt()), ENum(1).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '>=', ENum(2).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EArgMin(EBinOp(EVar('xs').with_type(TBag(TInt())), '-', ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var32').with_type(TInt()), EVar('_var32').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt())), ELambda(EVar('_var32').with_type(TInt()), EVar('_var32').with_type(TInt()))).with_type(TInt()), '==', EArgMin(EBinOp(EVar('_var66').with_type(TBag(TInt())), '-', ESingleton(EArgMin(EVar('_var66').with_type(TBag(TInt())), ELambda(EVar('_var32').with_type(TInt()), EVar('_var32').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt())), ELambda(EVar('_var32').with_type(TInt()), EVar('_var32').with_type(TInt()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('xs').with_type(TBag(TInt())), EVar('_var66').with_type(TBag(TInt()))]), collection_depth=2, validate_model=True)
  
      def test_argmin7(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EUnaryOp('sum', EMap(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var35').with_type(TInt()), ENum(1).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '>=', ENum(2).with_type(TInt())).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EUnaryOp('not', EBinOp(EVar('_var616').with_type(TInt()), 'in', EBinOp(EBinOp(EVar('xs').with_type(TBag(TInt())), '-', ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var35').with_type(TInt()), EVar('_var35').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt())), '-', ESingleton(EArgMin(EBinOp(EVar('xs').with_type(TBag(TInt())), '-', ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var35').with_type(TInt()), EVar('_var35').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt())), ELambda(EVar('_var35').with_type(TInt()), EVar('_var35').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EVar('_var616').with_type(TInt()), 'in', EBinOp(ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var35').with_type(TInt()), EVar('_var35').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())), '-', ESingleton(EArgMin(ESingleton(EArgMin(EVar('xs').with_type(TBag(TInt())), ELambda(EVar('_var35').with_type(TInt()), EVar('_var35').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt())), ELambda(EVar('_var35').with_type(TInt()), EVar('_var35').with_type(TInt()))).with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('xs').with_type(TBag(TInt())), EVar('_var616').with_type(TInt())]), collection_depth=2, validate_model=True)
  
      def test_minheap(self):
          e = EVar("h").with_type(TMinHeap(BOOL, INT))
          check_encoding(e, require=EGt(ELen(EHeapElems(e).with_type(BOOL_BAG)), TWO))
  
      def test_maxheap(self):
          e = EVar("h").with_type(TMaxHeap(BOOL, INT))
          check_encoding(e, require=EGt(ELen(EHeapElems(e).with_type(BOOL_BAG)), TWO))
  
      def test_lists1(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBool(True).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EVar('l').with_type(TList(TNative('Object'))), '==', EDropFront(EBinOp(EVar('l').with_type(TList(TNative('Object'))), '+', ESingleton(EListGet(EVar('l').with_type(TList(TNative('Object'))), ENum(0).with_type(TInt())).with_type(TNative('Object'))).with_type(TList(TNative('Object')))).with_type(TList(TNative('Object')))).with_type(TList(TNative('Object')))).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('l').with_type(TList(TNative('Object')))]), collection_depth=2, validate_model=True)
  
      def test_lists2(self):
          xs = EVar("xs").with_type(TList(INT))
          e = ENot(EEq(xs, xs))
          assert not satisfiable(e, collection_depth=2, validate_model=True)
  
      def test_lists3(self):
          xs = EVar("xs").with_type(TList(INT))
          ys = EVar("ys").with_type(TList(INT))
          e = EAll([EEq(xs, ys), EUnaryOp(UOp.Exists, xs).with_type(BOOL)])
          check_encoding(e, collection_depth=2)
  
      def test_lists4(self):
          xs = EVar("xs").with_type(TList(INT))
          e = EEq(xs, EDropFront(xs).with_type(xs.type))
          check_encoding(e, collection_depth=2)
  
      def test_lists5(self):
          xs = EVar("xs").with_type(TList(INT))
          e = EAll([
              EUnaryOp(UOp.Empty, EDropFront(xs).with_type(xs.type)).with_type(BOOL),
              EUnaryOp(UOp.Exists, xs).with_type(BOOL)])
          check_encoding(e, collection_depth=2)
  
      def test_listget_performance(self):
          a = EVar("a").with_type(TList(TString()))
          b = EVar("b").with_type(a.type)
          i = EVar("i").with_type(INT)
          f = EEq(EListGet(a, i).with_type(a.type.t), EListGet(b, i).with_type(a.type.t))
          for d in range(0, 6):
              d = 2**d
              print("depth={}...".format(d))
              m = satisfy(f, collection_depth=d, validate_model=True)
              print(m)
              assert m is not None
  
      def test_listget_regression1(self):
          satisfy(EUnaryOp('not', EBinOp(EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('exists', EVar('xs').with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool()), '=>', EBinOp(EUnaryOp('the', ECond(EStateVar(EVar('isDropped').with_type(TBool())).with_type(TBool()), EBinOp(EStateVar(EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TList(TFloat())), '-', ESingleton(EStateVar(EListGet(EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt())).with_type(TFloat())).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), EStateVar(EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TFloat()), '==', ECond(EStateVar(EVar('isDropped').with_type(TBool())).with_type(TBool()), ECond(EBinOp(EStateVar(EUnaryOp('the', EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TFloat())).with_type(TFloat()), '==', EStateVar(EListGet(EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt())).with_type(TFloat())).with_type(TFloat())).with_type(TBool()), EListGet(EStateVar(EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TList(TFloat())), ENum(1).with_type(TInt())).with_type(TFloat()), EStateVar(EUnaryOp('the', EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TFloat())).with_type(TFloat())).with_type(TFloat()), EStateVar(EUnaryOp('the', EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TFloat())).with_type(TFloat())).with_type(TFloat())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt()), EVar('isDropped').with_type(TBool())]), collection_depth=4, validate_model=True)
  
      def test_listget_regression2(self):
          satisfy(EUnaryOp('not', EBinOp(EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('exists', EVar('xs').with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool()), '=>', EBinOp(EUnaryOp('the', EMap(EBinOp(EStateVar(ECond(EVar('isDropped').with_type(TBool()), EVar('xs').with_type(TList(TFloat())), EEmptyList().with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TList(TFloat())), '-', ESingleton(EStateVar(EListGet(EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt())).with_type(TFloat())).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat()))).with_type(TFloat()), '==', EMapGet(EStateVar(EMakeMap2(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('_key6586').with_type(TFloat()), EVar('_key6586').with_type(TFloat()))).with_type(TMap(TFloat(), TFloat()))).with_type(TMap(TFloat(), TFloat())), EUnaryOp('the', EMap(EBinOp(EStateVar(ECond(EVar('isDropped').with_type(TBool()), EVar('xs').with_type(TList(TFloat())), EEmptyList().with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TList(TFloat())), '-', ESingleton(EStateVar(EListGet(EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt())).with_type(TFloat())).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat()))).with_type(TFloat())).with_type(TFloat())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt()), EVar('isDropped').with_type(TBool())]), collection_depth=4, validate_model=True)
  
      def test_listget_regression3(self):
          satisfy(EUnaryOp('not', EBinOp(EUnaryOp('not', EBool(True).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EVar('l').with_type(TList(TNative('Object'))), '==', EDropFront(EBinOp(EVar('l').with_type(TList(TNative('Object'))), '+', ESingleton(EListGet(EVar('l').with_type(TList(TNative('Object'))), ENum(0).with_type(TInt())).with_type(TNative('Object'))).with_type(TList(TNative('Object')))).with_type(TList(TNative('Object')))).with_type(TList(TNative('Object')))).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('l').with_type(TList(TNative('Object')))]), collection_depth=2, validate_model=True)
  
      def test_var_under_estatevar(self):
          # wow, very tricky!
          # EStateVar(...) needs to be "separable" from the parent, so bound vars
          # get cleared.  Thus, if EStateVar(x) appears somewhere, then `x` is
          # is free, even if it appears in e.g. \x -> EStateVar(x).
          x = EVar("x").with_type(INT)
          e = EUnaryOp(UOp.Exists, EFilter(ESingleton(ONE), ELambda(x, EStateVar(EEq(x, ZERO)))))
          print(pprint(e))
          assert retypecheck(e)
          model = satisfy(e, validate_model=True)
          print(model)
          assert model is not None
  
      def test_regression18(self):
          satisfy(ELet(EMakeMap2(EVar('xs').with_type(TBag(THandle('T', TNative('X')))), ELambda(EVar('_var1022').with_type(THandle('T', TNative('X'))), EUnaryOp('distinct', EMap(EVar('xs').with_type(TBag(THandle('T', TNative('X')))), ELambda(EVar('_var1021').with_type(THandle('T', TNative('X'))), EGetField(EVar('_var1022').with_type(THandle('T', TNative('X'))), 'val').with_type(TNative('X')))).with_type(TBag(TNative('X')))).with_type(TBag(TNative('X'))))).with_type(TMap(THandle('T', TNative('X')), TBag(TNative('X')))), ELambda(EVar('_var4063977').with_type(TMap(THandle('T', TNative('X')), TBag(TNative('X')))), ELet(EVar('xs').with_type(TBag(THandle('T', TNative('X')))), ELambda(EVar('_var4063972').with_type(TBag(THandle('T', TNative('X')))), EUnaryOp('not', EBinOp(EUnaryOp('not', EBool(True).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(EUnaryOp('len', EFilter(EFlatMap(EVar('_var4063972').with_type(TBag(THandle('T', TNative('X')))), ELambda(EVar('_var1022').with_type(THandle('T', TNative('X'))), EMapGet(EVar('_var4063977').with_type(TMap(THandle('T', TNative('X')), TBag(TNative('X')))), EVar('_var1021').with_type(THandle('T', TNative('X')))).with_type(TBag(TNative('X'))))).with_type(TBag(TNative('X'))), ELambda(EVar('_var0').with_type(TNative('X')), EBinOp(EVar('_var0').with_type(TNative('X')), '==', EVar('_var4063963').with_type(TNative('X'))).with_type(TBool()))).with_type(TBag(TNative('X')))).with_type(TInt()), '>', EUnaryOp('len', EFilter(EUnaryOp('distinct', EMap(EVar('xs').with_type(TBag(THandle('T', TNative('X')))), ELambda(EVar('_var1021').with_type(THandle('T', TNative('X'))), EGetField(EVar('_var1021').with_type(THandle('T', TNative('X'))), 'val').with_type(TNative('X')))).with_type(TBag(TNative('X')))).with_type(TBag(TNative('X'))), ELambda(EVar('_var0').with_type(TNative('X')), EBinOp(EVar('_var0').with_type(TNative('X')), '==', EVar('_var4063963').with_type(TNative('X'))).with_type(TBool()))).with_type(TBag(TNative('X')))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBool()))).with_type(TBool()), vars=OrderedSet([EVar('xs').with_type(TBag(THandle('T', TNative('X')))), EVar('_var1021').with_type(THandle('T', TNative('X'))), EVar('_var4063963').with_type(TNative('X'))]), collection_depth=3, validate_model=True)
  
      def test_floats(self):
          x = EVar("x").with_type(FLOAT)
          y = EVar("y").with_type(FLOAT)
          z = EVar("z").with_type(FLOAT)
          for op in ("+", "-", "*"):
              e = EEq(EBinOp(x, op, y).with_type(FLOAT), z)
              check_encoding(e)
  
      def test_float_constants(self):
          x = EVar("x").with_type(FLOAT)
          a = EVar("a").with_type(FLOAT)
          b = EVar("b").with_type(FLOAT)
          c = EVar("c").with_type(FLOAT)
          zero = ENum(0.0).with_type(FLOAT)
          one = ENum(1.0).with_type(FLOAT)
          n1 = ENum(6.0).with_type(FLOAT)
          n2 = ENum(-13685.0).with_type(FLOAT)
          e = EAll([
              EEq(EBinOp(x, "*", n1).with_type(FLOAT), n2),
              EEq(ECall("f", (EBinOp(x, "+", one).with_type(FLOAT),)).with_type(FLOAT), one),
              EEq(ECall("f", (a,)).with_type(FLOAT), zero),
              EEq(ECall("f", (b,)).with_type(FLOAT), zero),
              EEq(ECall("f", (c,)).with_type(FLOAT), zero),
              ])
          print(satisfy(e, validate_model=True))
  
      def test_regression19(self):
          e = ELet(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_tmp1008014').with_type(TBag(THandle('H', TNative('Value')))), ELet(EMakeMap2(EMap(EVar('_tmp1008014').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var1012').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var1012').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var1009').with_type(TNative('Value')), EEmptyList().with_type(TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), ELambda(EVar('_tmp1008019').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), ELet(EFlatMap(EVar('_tmp1008014').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var1012').with_type(THandle('H', TNative('Value'))), ESingleton(EVar('_var1012').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value')))))).with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_tmp1008026').with_type(TBag(THandle('H', TNative('Value')))), ELet(EVar('_var1008010').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), ELambda(EVar('_tmp1008048').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), ELet(EVar('_tmp1008014').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var1008013').with_type(TBag(THandle('H', TNative('Value')))), ELet(EMap(EVar('_tmp1008014').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var1012').with_type(THandle('H', TNative('Value'))), EVar('_tmp1008019').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))), ELambda(EVar('_var1008012').with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))), ELet(EVar('_tmp1008019').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), ELambda(EVar('_var1008011').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), ELet(EMapKeys(EVar('_var1008011').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBag(TNative('Value'))), ELambda(EVar('_tmp1008044').with_type(TBag(TNative('Value'))), EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EUnaryOp('unique', EVar('_tmp1008014').with_type(TBag(THandle('H', TNative('Value'))))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EVar('_tmp1008026').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var1012').with_type(THandle('H', TNative('Value'))), ELet(EVar('_var1012').with_type(THandle('H', TNative('Value'))), ELambda(EVar('_tmp1008029').with_type(THandle('H', TNative('Value'))), EUnaryOp('all', EMap(EVar('_tmp1008026').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var1013').with_type(THandle('H', TNative('Value'))), ELet(EVar('_var1013').with_type(THandle('H', TNative('Value'))), ELambda(EVar('_tmp1008030').with_type(THandle('H', TNative('Value'))), EBinOp(EUnaryOp('not', EBinOp(EVar('_tmp1008029').with_type(THandle('H', TNative('Value'))), '==', EVar('_tmp1008030').with_type(THandle('H', TNative('Value')))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EGetField(EVar('_tmp1008029').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')), '==', EGetField(EVar('_tmp1008030').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value'))).with_type(TBool())).with_type(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(EUnaryOp('len', EFilter(EFlatMap(EVar('_tmp1008044').with_type(TBag(TNative('Value'))), ELambda(EVar('_var1009').with_type(TNative('Value')), EVar('_var1008012').with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))), ELambda(EVar('_var0').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), EBinOp(EVar('_var0').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), '==', EVar('_tmp1008048').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBool()))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))))).with_type(TInt()), '>', EUnaryOp('len', EFilter(EFlatMap(EVar('_var1008013').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var1012').with_type(THandle('H', TNative('Value'))), EMap(EVar('_tmp1008044').with_type(TBag(TNative('Value'))), ELambda(EVar('_var1009').with_type(TNative('Value')), EMakeMap2(EEmptyList().with_type(TBag(TNative('Value'))), ELambda(EVar('_var1009').with_type(TNative('Value')), EEmptyList().with_type(TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))), ELambda(EVar('_var0').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), EBinOp(EVar('_var0').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), '==', EVar('_tmp1008048').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBool()))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBool()))).with_type(TBool()))).with_type(TBool()))).with_type(TBool()))).with_type(TBool()))).with_type(TBool()))).with_type(TBool()))).with_type(TBool())
          satisfy(e, vars=OrderedSet([EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), EVar('_var1008010').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))]), collection_depth=3, validate_model=True)
  
      def test_regression20(self):
          e = EUnaryOp('not', EBinOp(EUnaryOp('not', EBinOp(EUnaryOp('unique', EVar('xs').with_type(TBag(THandle('H', TNative('Value'))))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFlatMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var861').with_type(THandle('H', TNative('Value'))), ESingleton(EVar('_var861').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value')))))).with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var861').with_type(THandle('H', TNative('Value'))), EUnaryOp('all', EMap(EFlatMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var861').with_type(THandle('H', TNative('Value'))), ESingleton(EVar('_var861').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value')))))).with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var862').with_type(THandle('H', TNative('Value'))), EBinOp(EUnaryOp('not', EBinOp(EVar('_var861').with_type(THandle('H', TNative('Value'))), '==', EVar('_var862').with_type(THandle('H', TNative('Value')))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EGetField(EVar('_var861').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')), '==', EGetField(EVar('_var862').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value'))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'or', EUnaryOp('not', EBinOp(EUnaryOp('len', EFilter(EFlatMap(EMapKeys(EStateVar(EMakeMap2(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var861').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var861').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EEmptyList().with_type(TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EMap(EMapKeys(EStateVar(EMakeMap2(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var861').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var861').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EEmptyList().with_type(TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EStateVar(EMakeMap2(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var861').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var861').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EEmptyList().with_type(TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))), ELambda(EVar('_var0').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), EBinOp(EVar('_var0').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), '==', EVar('_var3546165').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBool()))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))))).with_type(TInt()), '>', EUnaryOp('len', EFilter(EFlatMap(EMapKeys(EStateVar(EMakeMap2(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var861').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var861').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EEmptyList().with_type(TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EMap(EMapKeys(EStateVar(EMakeMap2(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var861').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var861').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EEmptyList().with_type(TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EMakeMap2(EEmptyList().with_type(TBag(TNative('Value'))), ELambda(EVar('_var858').with_type(TNative('Value')), EEmptyList().with_type(TBag(THandle('H', TNative('Value')))))).with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))), ELambda(EVar('_var0').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), EBinOp(EVar('_var0').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))), '==', EVar('_var3546165').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))).with_type(TBool()))).with_type(TBag(TMap(TNative('Value'), TBag(THandle('H', TNative('Value'))))))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())
          satisfy(e, vars=OrderedSet([EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), EVar('_var3546165').with_type(TMap(TNative('Value'), TBag(THandle('H', TNative('Value')))))]), collection_depth=3, validate_model=True)
  
      def test_incremental_solver(self):
          s = IncrementalSolver()
          e1 = EVar("x").with_type(BOOL)
          e2 = EEq(EVar("x").with_type(INT), ZERO)
          s.satisfy(e1)
          s.satisfy(e2)
          s.satisfy(e1)
  
      def test_regression21(self):
          e = EBinOp(EMakeMinHeap(EVar('xs'), ELambda(EVar('x'), EVar('x'))), '==', EMakeMinHeap(EBinOp(EVar('xs'), '+', ESingleton(EVar('i'))), ELambda(EVar('x'), EVar('x'))))
          assert retypecheck(e, env={"xs": TBag(TNative("T")), "i": TNative("T")})
          assert not satisfiable(e, validate_model=True)
  
      def test_regression22(self):
          e = EUnaryOp('not', EBinOp(EMapGet(EStateVar(EMakeMap2(EMap(EVar('reqs').with_type(TBag(THandle('Request', TRecord((('rq_expiration', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('std::unique_ptr<ConnectionPool::GetConnectionCallback>'))))))), ELambda(EVar('_var1780').with_type(THandle('Request', TRecord((('rq_expiration', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('std::unique_ptr<ConnectionPool::GetConnectionCallback>')))))), EGetField(EGetField(EVar('_var1780').with_type(THandle('Request', TRecord((('rq_expiration', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('std::unique_ptr<ConnectionPool::GetConnectionCallback>')))))), 'val').with_type(TRecord((('rq_expiration', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('std::unique_ptr<ConnectionPool::GetConnectionCallback>'))))), 'rq_host').with_type(TNative('HostAndPort')))).with_type(TBag(TNative('HostAndPort'))), ELambda(EVar('_var1778').with_type(TNative('HostAndPort')), EMapGet(EMakeMap2(EMap(EVar('conns').with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), ELambda(EVar('_var944').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EGetField(EGetField(EVar('_var944').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'val').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('HostAndPort')))).with_type(TBag(TNative('HostAndPort'))), ELambda(EVar('_var943').with_type(TNative('HostAndPort')), EFilter(EVar('conns').with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), ELambda(EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EBinOp(EBinOp(EGetField(EGetField(EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'val').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('HostAndPort')), '==', EVar('_var943').with_type(TNative('HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EGetField(EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'val').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))))).with_type(TMap(TNative('HostAndPort'), TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))), EVar('_var1778').with_type(TNative('HostAndPort'))).with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))))).with_type(TMap(TNative('HostAndPort'), TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))))).with_type(TMap(TNative('HostAndPort'), TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))), EVar('p').with_type(TNative('HostAndPort'))).with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), '===', EMapGet(EStateVar(EMakeMap2(EMap(EVar('reqs').with_type(TBag(THandle('Request', TRecord((('rq_expiration', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('std::unique_ptr<ConnectionPool::GetConnectionCallback>'))))))), ELambda(EVar('_var1780').with_type(THandle('Request', TRecord((('rq_expiration', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('std::unique_ptr<ConnectionPool::GetConnectionCallback>')))))), EGetField(EGetField(EVar('_var1780').with_type(THandle('Request', TRecord((('rq_expiration', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('std::unique_ptr<ConnectionPool::GetConnectionCallback>')))))), 'val').with_type(TRecord((('rq_expiration', TNative('Date_t')), ('rq_host', TNative('HostAndPort')), ('rq_callback', TNative('std::unique_ptr<ConnectionPool::GetConnectionCallback>'))))), 'rq_host').with_type(TNative('HostAndPort')))).with_type(TBag(TNative('HostAndPort'))), ELambda(EVar('_var1778').with_type(TNative('HostAndPort')), EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), ELambda(EVar('_var5034').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EBinOp(EGetField(EGetField(EVar('_var5034').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'val').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('HostAndPort')), '==', EVar('_var1778').with_type(TNative('HostAndPort'))).with_type(TBool()))).with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), ELambda(EVar('_var5035').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EFilter(EVar('conns').with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), ELambda(EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EBinOp(EBinOp(EGetField(EGetField(EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'val').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('HostAndPort')), '==', EGetField(EGetField(EVar('_var5035').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'val').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EGetField(EVar('c').with_type(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'val').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))))).with_type(TBag(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))))).with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))))).with_type(TMap(TNative('HostAndPort'), TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))))).with_type(TMap(TNative('HostAndPort'), TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))), EVar('p').with_type(TNative('HostAndPort'))).with_type(TBag(THandle('Connection', TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('HostAndPort')), ('conn_iface', TNative('ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('Date_t')), ('conn_returned', TNative('Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TBool())).with_type(TBool())
          assert not satisfiable(e, validate_model=True)
  
      def test_caching_solver(self):
          e = EEq(EVar("x").with_type(INT), EVar("y").with_type(INT))
          s = ModelCachingSolver(vars=free_vars(e), funcs=())
          assert s.satisfiable(e)
          assert s.satisfiable(e)
          assert s.calls == 2
          assert s.hits == 1
  
      def test_regression26(self):
          e = EMap(EVar('_tmp639').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EVar('x').with_type(TFloat()))).with_type(TList(TFloat()))
          v = fresh_var(e.type)
          check_encoding(EEq(e, v))
  
      def test_regression27(self):
          e = EUnaryOp('not', EBinOp(EBinOp(EUnaryOp('sum', EMap(EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat())), ELambda(EVar('_var633').with_type(TFloat()), ENum(4).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '+', ENum(4).with_type(TInt())).with_type(TInt()), '<=', EBinOp(EUnaryOp('sum', EMap(EMap(EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EVar('x').with_type(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('_var634').with_type(TFloat()), ENum(4).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '+', ENum(4).with_type(TInt())).with_type(TInt())).with_type(TBool())).with_type(TBool())
          v = fresh_var(e.type)
          check_encoding(EEq(e, v))
  
      def test_lambdacache_type_conflict(self):
          i = IncrementalSolver(validate_model=True)
          xs = EVar("xs").with_type(INT_BAG)
          e1 = EMap(xs, ELambda(EVar("x"), EVar("x")))
          ys = EVar("ys").with_type(BOOL_BAG)
          e2 = EMap(ys, ELambda(EVar("x"), EVar("x")))
          assert retypecheck(e1)
          assert retypecheck(e2)
  
          for e in (e1, e2):
              v = fresh_var(e.type)
              assert i.satisfiable(EEq(e, v))
  
      def test_list_slice(self):
          e = EListSlice(EVar('xs').with_type(TList(TFloat())), ENum(0).with_type(TInt()), EVar('index').with_type(TInt())).with_type(TList(TFloat()))
          check_encoding(e)
  
      def test_regression28(self):
          satisfy(EBinOp(EBinOp(EBinOp(EVar('index').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('index').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('not', EBinOp(EBinOp(EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), ENum(0).with_type(TInt()), EVar('index').with_type(TInt())).with_type(TList(TFloat())), '+', EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), EBinOp(EVar('index').with_type(TInt()), '+', ENum(1).with_type(TInt())).with_type(TInt()), EStateVar(EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TInt())).with_type(TList(TFloat()))).with_type(TList(TFloat())), '==', EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), ENum(0).with_type(TInt()), EUnaryOp('-', ENum(1).with_type(TInt())).with_type(TInt())).with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('index').with_type(TInt())]), collection_depth=4, validate_model=True)
  
      def test_heap_2ndmin(self):
          xs = EVar("xs").with_type(INT_BAG)
          x = EVar("x").with_type(xs.type.t)
          f = ELambda(x, x)
          for mkh in (EMakeMinHeap, EMakeMaxHeap):
              h = mkh(xs, f)
              e = ENot(EEq(EHeapPeek(h, ELen(xs)), EHeapPeek2(h, ELen(xs))))
              assert retypecheck(e)
              assert satisfiable(e, validate_model=True)
  
      def test_to_heap(self):
          for f in (EArgMin, EArgMax):
              xs = EVar("xs").with_type(INT_BAG)
              x = EVar("x").with_type(xs.type.t)
              e = f(xs, ELambda(x, EUnaryOp("-", x)))
              assert retypecheck(e)
              assert valid(EEq(e, EHeapPeek(to_heap(e), ELen(e)).with_type(INT)))
  
      def test_regression29(self):
          satisfy(EUnaryOp('not', EBinOp(EBool(True).with_type(TBool()), '=>', EBinOp(EArgMax(EBinOp(ESingleton(EBinOp(EUnaryOp('sum', EMap(ECond(EBinOp(EMapGet(EMakeMap2(EMap(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('_var77592').with_type(TFloat()), EUnaryOp('len', EFilter(EMap(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('_var77593').with_type(TFloat()), EBinOp(EVar('_var77592').with_type(TFloat()), '==', EVar('_var77593').with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TInt()))).with_type(TMap(TFloat(), TInt())), ENum(1.0).with_type(TFloat())).with_type(TInt()), '==', ENum(1).with_type(TInt())).with_type(TBool()), EEmptyList().with_type(TList(TFloat())), ESingleton(ENum(1.0).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('_var2195290').with_type(TFloat()), ENum(4).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '+', ENum(4).with_type(TInt())).with_type(TInt())).with_type(TBag(TInt())), '+', ESingleton(EBinOp(EUnaryOp('sum', EMap(ECond(EBinOp(EMapGet(EMakeMap2(EMap(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('_var77592').with_type(TFloat()), EUnaryOp('len', EFilter(EMap(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('_var77593').with_type(TFloat()), EBinOp(EVar('_var77592').with_type(TFloat()), '==', EVar('_var77593').with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TInt()))).with_type(TMap(TFloat(), TInt())), ENum(1.5).with_type(TFloat())).with_type(TInt()), '==', ENum(1).with_type(TInt())).with_type(TBool()), EEmptyList().with_type(TList(TFloat())), ESingleton(ENum(1.5).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('_var2195292').with_type(TFloat()), ENum(4).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '+', ENum(4).with_type(TInt())).with_type(TInt())).with_type(TBag(TInt()))).with_type(TBag(TInt())), ELambda(EVar('x').with_type(TInt()), EVar('x').with_type(TInt()))).with_type(TInt()), '>=', EBinOp(EUnaryOp('sum', EMap(ECond(EBinOp(EMapGet(EMakeMap2(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('_var66768').with_type(TFloat()), EUnaryOp('len', EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('_var66769').with_type(TFloat()), EBinOp(EVar('_var66768').with_type(TFloat()), '==', EVar('_var66769').with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TInt()))).with_type(TMap(TFloat(), TInt())), ENum(1.5).with_type(TFloat())).with_type(TInt()), '==', ENum(1).with_type(TInt())).with_type(TBool()), EEmptyList().with_type(TList(TFloat())), ESingleton(ENum(1.5).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('_var2195293').with_type(TFloat()), ENum(4).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '+', ENum(4).with_type(TInt())).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt()), EVar('xs').with_type(TList(TFloat())), EVar('_var155564').with_type(TFloat()), EVar('_var158099').with_type(TFloat()), EVar('_var159048').with_type(TFloat()), EVar('_var160499').with_type(TFloat()), EVar('x').with_type(TFloat())]), collection_depth=4, validate_model=True)
  
      def test_bag_subtraction_encoding_speed(self):
          e = EBinOp(EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EBinOp(EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool()), 'and', EBinOp(EUnaryOp('len', EBinOp(EBinOp(EBinOp(EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_expiration').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), '+', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_next_refresh').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), '+', EMap(EFilter(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), '-', EBinOp(EBinOp(EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_expiration').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), '+', EMap(EFilter(EBinOp(EBinOp(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '-', ESingleton(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EVar('retId').with_type(TInt())), ('conn_dropped', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var433').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('_var433').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var434').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('_var434').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_next_refresh').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), '+', EMap(EFilter(EMap(EBinOp(EBinOp(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '-', ESingleton(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EVar('retId').with_type(TInt())), ('conn_dropped', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var435').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('_var435').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EBinOp(EBinOp(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '-', ESingleton(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EVar('retId').with_type(TInt())), ('conn_dropped', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var436').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var436').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var436').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var437').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var437').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), ECall('after', (EArgMax(EMap(EMap(EFilter(EBinOp(EBinOp(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '-', ESingleton(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EVar('retId').with_type(TInt())), ('conn_dropped', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var438').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var438').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var438').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var439').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var439').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var440').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('_var440').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TInt()), '>', ENum(1).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool())
          assert satisfiable(e, validate_model=True)
  
      def test_regression30(self):
          satisfy(EUnaryOp('not', EBinOp(EBool(True).with_type(TBool()), '=>', EBinOp(EBinOp(EUnaryOp('sum', EMap(EMap(EBinOp(EVar('reqs').with_type(TSet(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), '+', EVar('reqs').with_type(TSet(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TSet(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('_var7757541').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('_var7757541').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('_var7765571').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), ENum(12).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '+', ENum(4).with_type(TInt())).with_type(TInt()), '>=', EBinOp(EUnaryOp('sum', EMap(EBinOp(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), '+', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('_var7765572').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), ENum(12).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TInt()), '+', ENum(4).with_type(TInt())).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), vars=OrderedSet([EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('retId').with_type(TInt()), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('now').with_type(TNative('mongo::Date_t')), EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('_var134975').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('_var140097').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var142487').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('_var144896').with_type(TSet(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var147967').with_type(TList(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), EVar('_var151056').with_type(TList(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*'))), EVar('_var154024').with_type(TList(TNative('mongo::HostAndPort'))), EVar('_var158004').with_type(TList(TBool())), EVar('_var161210').with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var165082').with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('_var168721').with_type(TList(TNative('mongo::Date_t'))), EVar('_var172454').with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('_var185962').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('_var190095').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var194791').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('_var202417').with_type(TSet(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var38203').with_type(TNative('mongo::Milliseconds')), EVar('_var39713').with_type(TNative('mongo::HostAndPort')), EVar('_var40370').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('_var41695').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), EVar('_var55289').with_type(TInt()), EVar('_var57710').with_type(TInt()), EVar('_var59325').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var61549').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('_var62456').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EVar('_var66853').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), EVar('_var68361').with_type(TNative('mongo::HostAndPort')), EVar('_var127106').with_type(TNative('mongo::HostAndPort')), EVar('_var129859').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('_var132639').with_type(TNative('mongo::Date_t')), EVar('_var3908034').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('_var137119').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), EVar('_var4190399').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var4299262').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('_var4387932').with_type(TSet(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var4483236').with_type(TList(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), EVar('_var4569137').with_type(TList(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*'))), EVar('_var4655577').with_type(TList(TNative('mongo::HostAndPort'))), EVar('_var4738746').with_type(TList(TBool())), EVar('_var4818493').with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var4915478').with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('_var5007032').with_type(TList(TNative('mongo::Date_t'))), EVar('_var5094414').with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('_var5507733').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('_var5600856').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var5792496').with_type(TSet(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_var206374').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var221798').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('_var235214').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EVar('_var272630').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('_var297956').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), EVar('_var319668').with_type(TNative('mongo::HostAndPort')), EVar('_var379822').with_type(TNative('mongo::Date_t')), EVar('_var401892').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var415046').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))]), collection_depth=4, validate_model=True)
  