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

Input of rule attributes from the user #748

Open
rensink opened this issue Oct 26, 2016 · 4 comments
Open

Input of rule attributes from the user #748

rensink opened this issue Oct 26, 2016 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@rensink
Copy link
Collaborator

rensink commented Oct 26, 2016

It would be nice if we could enter the input parameter of a rule from a dialog in the Simulator. The idea is to associate parin:x tags to attribute nodes in a rule and when a rule is applied a dialog pops up asking for the value.
In a automatic exploration, such rules would have to assume a default value for the inputs (or take them from some where else).

Reported by: zambon

@rensink
Copy link
Collaborator Author

rensink commented Nov 1, 2016

  • status: open --> pending
  • assigned_to: Arend Rensink
  • Group: -->

Original comment by: rensink

@rensink
Copy link
Collaborator Author

rensink commented Nov 1, 2016

I've added a grammar property "oracleValue" with a setting "dialog" (next to "default" and "random") that does pretty much what you want, although not quite:

  • You have to enter the parameter value at the moment the state is added to the GTS, because that is the moment the Simulater scans it for applicable rules; and not when you want to explore the transition. The value is asked for in the course of the matching process. It would be a rather more far-reaching extension to change this, as that would entail there are two matching modes: a preliminary one in which the existence of a match is noted but the value is not fixed and a definitive one in which the target state is constructed.

  • If the value is set to "dialog", that is also used during automatic exploration.

Let met know what you think of this solution: is it usable, (how) should it be improved?

Original comment by: rensink

@rensink
Copy link
Collaborator Author

rensink commented Nov 1, 2016

I've just tried the new feature but unfortunately it is quite cumbersome to use. I was thinking something in the lines of the description of your hard-to-implement solution: to provide the attribute value only after the rule is selected for application.

My main interest in this is by inserting a kind of "documentation" in the graphs. In this sense, I don't expect these input attributes to have any impact in the grammar behaviour. (Probably this is too simple of a test case but it's the one I'm facing now.)

Wouldn't it be possible to ask for the value as a post-rule application wrap-up? Here's my current scenario. I want to create a new node with "type:Kind" and assign it a "string:name" attribute, so I plan to have as a rule:

new: par:
type:Kind ------ name ----> string:

I see two use cases with such a rule:

  1. You use a control program that binds the parameter.
  2. You set a oracle (for instance, dialog) that produces a proper argument.

Currently, using 2), as soon as the grammar is loaded, the rule is enabled and the dialog pops up and locks the Simulator. Most of the time I didn't want to do any rule application in the first place, but this new dialog gets in the way.

I'm most probably wrong but I was thinking that since the input node is an attribute node that is isolated in the LHS, it should not the part of the search plan, no?

Original comment by: zambon

@rensink
Copy link
Collaborator Author

rensink commented Nov 1, 2016

Regarding your use case 1) certainly the oracle will not be used any more as soon as the value is bound by a control program. That is automatic.

Regarding use case 2) I quite see that your scenario is preferable, for the reason that you give; but it requires late binding of the node, and that is counter to how things currently work. Indeed all LHS elements are part of the search plan, the idea is that after matching all nondeterminism has been resolved.

After finishing the current implementation I thought about it some more; maybe it is possible to introduce the concept of a "don't know" value in every algebra to which such an attribute value can be bound during matching, and which is substituted by a real value only when the target graph of the rule is computed.

Original comment by: rensink

@rensink rensink self-assigned this Mar 7, 2024
@rensink rensink added enhancement New feature or request and removed feature-request labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant