Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Jun 30, 2025

This pr introduces ConstructorIds and MethodIds as part of the signature. The types of their arguments are given in the signature as well.

Benefits:

  1. We don't need to use existential types for Args in the AppData.
  2. We don't need to include the logic function in the AppData.
  3. It has become easier to translate our model into an implementation in a language such as Rust or Elixir.

@janmasrovira janmasrovira self-assigned this Jun 30, 2025
commit 30aeb16
Author: Jan Mas Rovira <[email protected]>
Date:   Wed Jul 2 15:41:33 2025 +0200

    compiles

commit 965524a
Author: Jan Mas Rovira <[email protected]>
Date:   Wed Jul 2 13:30:22 2025 +0200

    translation

commit 95287e7
Author: Jan Mas Rovira <[email protected]>
Date:   Mon Jun 30 16:03:28 2025 +0200

    wip

commit 4c41503
Author: Jan Mas Rovira <[email protected]>
Date:   Mon Jun 30 15:37:59 2025 +0200

    update to v4.21.0 and add mathlib
@janmasrovira janmasrovira marked this pull request as ready for review July 3, 2025 07:57
@janmasrovira janmasrovira requested a review from lukaszcz July 3, 2025 07:57
-- TODO how to do this without tactics?
{args with data := by {
rw [x] at memArgs
apply memArgs }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not readable. I don't know what's going on here.

In general, I think we should reduce the number of different AppData types, ideally to one. I added more for type-checking convenience, but maybe we can get rid of this duplication now that we have casts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

AppData contains: memberId, public fields, arguments. The arguments can have different types depending on memberId, but if we store args type representation in memberId, we can do the casting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the above does not require any casting. For some reason lean was unable to typecheck properly without this explicit proof. Maybe there is an easier way to do this, but I didn't know how

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, okay, let's leave it. But I meant something more general: I don't think we need all those different nested AppData types. This gets too complicated. But we can refactor this in a different PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah yes, I'd like that too. I was often getting confused with the different AppData types

match mself with
| none => False
| (some self) =>
let msomeAppData : Option (Member.SomeAppData sig.pub) := args.data.memberSomeAppData
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, okay, so now app data can be none and that's what happens in the created case.

@lukaszcz lukaszcz merged commit e4857a4 into main Jul 3, 2025
2 checks passed
@lukaszcz lukaszcz deleted the signature-members branch July 3, 2025 14:03
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.

3 participants