diff --git a/src/library/kernel_serializer.cpp b/src/library/kernel_serializer.cpp index 3ca12b0ee..92bd28766 100644 --- a/src/library/kernel_serializer.cpp +++ b/src/library/kernel_serializer.cpp @@ -132,9 +132,22 @@ static binder_info read_binder_info(deserializer & d) { return binder_info(imp, cast, ctx, s_imp); } +static name g_binder_name("a"); + class expr_serializer : public object_serializer { typedef object_serializer super; max_sharing_fn m_max_sharing_fn; + unsigned m_next_id; + + void write_binder_name(serializer & s, name const & a) { + // make sure binding names are atomic string + if (!a.is_atomic() || a.is_numeral()) { + s << g_binder_name.append_after(m_next_id); + m_next_id++; + } else { + s << a; + } + } void write_core(expr const & a) { auto k = a.kind(); @@ -161,7 +174,8 @@ class expr_serializer : public object_serializer