Closed greenTara closed 10 years ago
if we drop the value "reasoning" from the style datatype, and use the absence of the style attribute as the indicator that the style is reasoning
I agree with the proposed assumption based semantics, that there is an implicitly assumed default value for attributes. These assumptions need to be documented in the schema specification then and we need to specify the semantics of these assumptions, e.g.
the assumed default values might change depending on the (Reaction) RuleML dialect, e.g. for the temporal DR reasoning dialect and the KR dialect the assumed default value for the style attribute would be “reasoning”, whereas in PR and the Event Processing dialects it would be “active”.
since Reaction RuleML supports modularization and scopes the default semantics for inheritance of the default values to inner nested scopes needs to be specified. For instance, if the outer scope explicitly defines a scope with value “active” then this value by “default inheritance semantics” should be inherited to the inner scopes, even if the value is not explicitly defined there and the default assumed value would be “reasoning”. In the semantic profiles the default inheritance semantics can be replaced by an explicit semantics, e.g. “backward” inheritance ( where the semantics is inherited to the inner scopes) and “forward” inheritance (where the semantics of the inner scopes overrules the semantics of the outer scopes).
-Adrian
Von: Tara Athan [mailto:notifications@github.com] Gesendet: Dienstag, 28. Januar 2014 00:16 An: RuleML/reaction-ruleml Betreff: [reaction-ruleml] Eliminating default values of attributes (#10)
There is a large overhead to handling "default values" of attributes in Relax NG. And there seems to be little value added from this characteristic. The only advantages I can think of are:
The principal disadvantage, from the RNC perspective, is the extra code necessary to handle this feature. As an example, here is the beginning of the coding for the RR @style https://github.com/style attribute, which has default value "reasoning".
#
style.datatype |= "reasoning"
style.datatype |= "active" | "messaging"
#
style.attrib = style-att-inf.choice
style-att-inf.choice |= notAllowed
style-att-inf.choice |= empty
style-att-inf.choice |= style-att.choice
style-att.choice |= attribute style { style.datatype }
The remaining steps to implement this code would be to create the modules:
In a driver schema for the compact syntax where the attributes with default values must be absent:
include default_inf_reactive_expansion_module.rnc include default_absent_reactive_expansion_module.rnc
In a driver schema for the normalized syntax where the attributes with default values must be present:
include default_inf_reactive_expansion_module.rnc include default_present_reactive_expansion_module.rnc
In a driver schema for the relaxed syntax where the attributes with default values may be absent or present:
include default_inf_reactive_expansion_module.rnc include default_absent_reactive_expansion_module.rnc include default_present_reactive_expansion_module.rnc
In addition, when the fine-grained modularization of RR is implemented, there would need to be the following modules:
In comparison, if we drop the value "reasoning" from the style datatype, and use the absence of the style attribute as the indicator that the style is reasoning, (and similarly for @mode https://github.com/mode , @safety https://github.com/safety , @size https://github.com/size ) then
— Reply to this email directly or view it on GitHub https://github.com/RuleML/reaction-ruleml/issues/10 . https://github.com/notifications/beacon/2492924__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNjM5NzM0NiwiZGF0YSI6eyJpZCI6MjQzNzA3MzF9fQ==--c17c09c931326dc7168a2e2a5248f3d4e3c85607.gif
I think we need a suite of examples. It is not clear to me how scopes are defined.
Here the list of attributes with default values
@mode default=? @safety default=non-interrupting @per default=copy @size default=-1 @style default=reasoning
@mapMaterial default=yes @material default=yes @mapDirection default=bidirectional @direction default=bidirectional
@oriented default=no
@val default=0..
There are only four of these attributes that "belong" to Reaction RuleML: @mode default=? @safety default=non-interrupting @size default=-1 @style default=reasoning
The others are built in to Deliberation RuleML, and we don't have the option to modify their syntax in version 1.0 (although we can always choose the Deliberation RuleML sublanguage that doesn't allow the attribute to take on its default value.)
The initial change to be made in dr.rnc is to remove the default value from the content model of each attribute.
More explicitly the code for the style attribute is reduced to
# *** @style ***
#
# restriction: active | messaging (in DR Reaction RuleML)
# optional attribute
style.attrib = style-att.choice
style-att.choice |= attribute style { style.datatype }
style.datatype |= "active" | "messaging"
I have removed all default value definitions in the XSD, RelaxNG XML and RNC, but kept the attribute values in the attributes content model.
This seems like a good solution to me.
I take this to mean that normalization will make no changes to these attributes - it will not add an attribute if one is missing, nor will it take it away if its vaue is the "default" value. So it will be valid in the normalized form to have either no attribute or the attribute with any of the original values. Is this what you had in mind?
I think we need to keep the default value of @per to be "copy". This is the way it is in Deliberation RuleML 1.0. When we modify Deliberation RuleML to get rid of the default values of attributes there, @per will be modified at that time.
closed by 5aad12ce91e0dc70ef02c1df77d527b50ab661c9
There is a large overhead to handling "default values" of attributes in Relax NG. And there seems to be little value added from this characteristic. The only advantages I can think of are:
The principal disadvantage, from the RNC perspective, is the extra code necessary to handle this feature. As an example, here is the beginning of the coding for the RR @style attribute, which has default value "reasoning".
The remaining steps to implement this code would be to create the modules:
In a driver schema for the compact syntax where the attributes with default values must be absent:
In a driver schema for the normalized syntax where the attributes with default values must be present:
In a driver schema for the relaxed syntax where the attributes with default values may be absent or present:
In addition, when the fine-grained modularization of RR is implemented, there would need to be the following modules:
In comparison, if we drop the value "reasoning" from the style datatype, and use the absence of the style attribute as the indicator that the style is reasoning, (and similarly for @mode, @safety, @size) then