Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

51 get examples of custom rules #236

Closed
wants to merge 11 commits into from

Conversation

deemp
Copy link
Member

@deemp deemp commented Mar 27, 2024

Closes #51

Links:


PR-Codex overview

This PR enhances the specifications.yaml file by defining MetaBinding patterns and functions for manipulating bindings.

Detailed summary

  • Defined MetaBinding patterns for matching bindings
  • Added functions for manipulating bindings like $replace and $combine

The following files were skipped due to too many changes: user-defined-functions/use-cases.yaml

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@deemp deemp linked an issue Mar 27, 2024 that may be closed by this pull request
14 tasks
@deemp deemp marked this pull request as draft March 27, 2024 22:12
@deemp deemp changed the title 51 get examples of user defined functions 51 get examples of user-defined functions Mar 28, 2024
- pattern: |
FunctionMt. Function ::= "$mt" "(" <prefix :: (Expression)> "," <suffix :: (Expression)> ")"
description: |
Return the string "<prefix>.<suffix>".
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not think we should work with strings. We should work with AST. <prefix> should be a valid $\varphi$-term and <suffix> should be a valid attribute (or chain of dispatch/application).

Also naming is not explained. Why mt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And also, why do we need $mt if we can simply use dot .?

Copy link
Member Author

@deemp deemp Mar 29, 2024

Choose a reason for hiding this comment

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

I do not think we should work with strings.

Yes, it should be a dispatch.

Also naming is not explained. Why mt?

IDK. It comes from use cases. I'd prefer $dot.

And also, why do we need $mt if we can simply use dot?

I believe we shouldn't use dot with functions, should we? Which option looks better?

  1. a.$name(b)
  2. $dot(a, $name(b))

- pattern: |
FunctionName. Function ::= "$name" "(" <binding :: (MetaId)> ")"
description: |
Return the name of <binding>.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need it if we have ?a for the name already?

Copy link
Member Author

Choose a reason for hiding this comment

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

We may not have the name in case of \?A ?a..b -> c

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, we can use $name to extract all names from a list of bindings.
We may need to do that when we need to check that a name of some binding doesn't belong to that list.

@deemp deemp force-pushed the 51-collect-examples-of-user-defined-functions branch from 94e598b to d430007 Compare March 29, 2024 07:34
@deemp deemp force-pushed the 51-collect-examples-of-user-defined-functions branch from d430007 to dbdf23b Compare March 29, 2024 07:57
@deemp deemp requested a review from fizruk March 29, 2024 07:59
@deemp deemp changed the title 51 get examples of user-defined functions 51 get examples of custom rules Apr 5, 2024
@deemp
Copy link
Member Author

deemp commented Apr 24, 2024

Closing because this PR was split into #259 and #258.

@deemp deemp closed this Apr 24, 2024
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.

Get specifications of user-defined functions
2 participants