12345678910111213141516171819202122232425262728293031openCore_kernelopen!ImportopenTypes.KindmoduleNode=Types.Nodetype'at='aTypes.Snapshot.t={main:'aNode.t;at:Time_ns.t;before:'a;value_at:'aNode.t;clock:(Types.Clock.t[@sexp.opaque])}[@@derivingfields,sexp_of]letinvariantinvariant_at=Invariant.invariant[%here]t[%sexp_of:_t](fun()->letcheckf=Invariant.check_fieldtfinFields.iter~main:(check(fun(main:_Node.t)->assert(Scope.is_topmain.created_in);matchmain.kindwith|Invalid->()(* happens when snapshotting an invalid node *)|Const_->()(* happens after the snapshot *)|Snapshott'->assert(phys_equaltt')|_->assertfalse))~at:ignore~before:(checkinvariant_a)~value_at:ignore~clock:ignore);;