public static DfaValue dropLocality(DfaValue value, DfaMemoryState state) {
    if (!(value instanceof DfaVariableValue var)) {
      DfType type = value.getDfType();
      if (type.isLocal() && type instanceof DfReferenceType) {
        DfReferenceType dfType = ((DfReferenceType)type).dropLocality();
        if (value instanceof DfaWrappedValue) {
          return value.getFactory().getWrapperFactory()
            .createWrapper(dfType, ((DfaWrappedValue)value).getSpecialField(), ((DfaWrappedValue)value).getWrappedValue());
        }
        return value.getFactory().fromDfType(dfType);
      }
      return value;
    }
    UnaryOperator<@NotNull DfType> updater = dfType -> dfType instanceof DfReferenceType refType ? refType.dropLocality() : dfType;
    state.updateDfType(var, updater);
    for (DfaVariableValue v : new ArrayList<>(var.getDependentVariables())) {
      state.updateDfType(v, updater);
    }
    return value;
  }
public static DfaValue dropLocality(DfaValue value, DfaMemoryState state)