Skip to content

Comments

Name collisions#1346

Open
agontard wants to merge 1 commit intoDeducteam:masterfrom
agontard:name_collisions
Open

Name collisions#1346
agontard wants to merge 1 commit intoDeducteam:masterfrom
agontard:name_collisions

Conversation

@agontard
Copy link

@agontard agontard commented Jan 27, 2026

  • Check if an identifier (in particular, a variable name) is one of the mapped Rocq identifiers.
  • If so, add the "__alt__" suffix to disambiguate them

@fblanqui
Copy link
Member

Thank you Antoine for your PR but there seems to be unjustified changes. Please minimize the diff (be careful with changes in the indentation).

@agontard
Copy link
Author

Thank you Antoine for your PR but there seems to be unjustified changes. Please minimize the diff (be careful with changes in the indentation).

Could you be clearer on what you call unjustified ? Is there something apart from the two lines where I changed the indentation to match the rest of the file ?

@fblanqui
Copy link
Member

When I look at https://github.com/Deducteam/lambdapi/pull/1346/files, I see many "changes" from line 311 that do not seem necessary. Perhaps there is actually no changes except in the indentation. But this is the kind of changes that should be avoided in order to more easily track changes back in time when something gets broken. See for instance the "blame" function of Github on https://github.com/Deducteam/lambdapi/blame/master/src/export/coq.ml.

@agontard
Copy link
Author

When I look at https://github.com/Deducteam/lambdapi/pull/1346/files, I see many "changes" from line 311 that do not seem necessary. Perhaps there is actually no changes except in the indentation. But this is the kind of changes that should be avoided in order to more easily track changes back in time when something gets broken. See for instance the "blame" function of Github on https://github.com/Deducteam/lambdapi/blame/master/src/export/coq.ml.

I never thought about it that way ! Indeed important then.

| P_symbol
{ p_sym_mod; p_sym_nam; p_sym_arg; p_sym_typ;
p_sym_trm; p_sym_prf=_; p_sym_def } ->
if not (StrSet.mem p_sym_nam.elt !erase) then
Copy link
Member

@fblanqui fblanqui Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to change the command function here and above.

Stream.iter consume (Parser.parse_file f)

(** true if id is in the image of !rmap *)
let is_existing_rocq_id id = StrMap.exists (fun _ id' -> id == id') !rmap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be unfolded because it is short and used only once.

@agontard
Copy link
Author

@fblanqui In the end just one line to change. I tested that it works, through checking Real_def/Real_with_N without mapping for "+", which normally creates a name collision because of the renaming to "add" in renaming.lp in hol2dk, which is also the name of a variable in a proof which uses "+".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants