Closed tmitsi closed 4 years ago
Add subclass_expansion_module based on the equal_expansion_module.
Subclass-specific changes in subclass_expansion_module:
Forall-node.choice |= Subclass-node.choice
(i.e. allow subclass inside a Forall wrapper).subTerm.choice |= Relation-node.choice
(i.e. allow only relations in sub and super)Equal.header &= TruthValuedConnective.header?
In init_expansion module:
Relation-node.choice |= notAllowed
in # TERM CHOICE PATTERNS
# ATTRIBUTES WITH DEFAULT VALUES
, modify to Subclass-datt.choice |= empty
Modify schema_rnc.php
to include the subclass module, e.g.:
$quant_subclass = 3;
...
$needSubclass = extractBit($bquant, $quant_subclass);
...
// Include Subclass
if ($needSubclass){
echo "#\n# SUBCLASS INCLUDED\n";
echo "#\n".'include "' . $modulesLocation .
'subclass_expansion_module.rnc"'."$end\n";
}
Modify relevant config scripts in bash folder (e.g., bash/config_rnc.txt
) to include new bits (initially for PSOA anchor languages).
It would be good to justify some decisions for later reference.
There are other occurrences of “Equal” in the modules that have not yet been addressed e.g. stripe skipping, style.
Because the edges will be skippable, the normalizer and compactifier need to be modified.
Degree could be allowed in Subclass: (see below)
In init_expansion_module
, the datt pattern set as Subclass-datt.choice |= notAllowed
passes the validation with batch_val by modifying default_inf_expansion_module
:
Subclass-datt.choice |=
mapMaterial-att-fo.choice & mapDirection-att-fo.choice
but my test case fails. I will set it to empty. See https://github.com/RuleML/issues-ruleml/issues/84#issuecomment-584823103.
In attribute_expansion_module
add reSubclass.attlist &= style-att.choice?
In stripe_skipping_expansion_module
add
subSide-edge.choice |= sub.content
superSide-edge.choice |= super.content
For other formula nodes, the degree edge is brought into the "header" part of the content model through the pattern TruthValuedConnective.header. This is the line that is in the equal module, but was deleted for Subclass. In PSOA drivers, the degree module is not included because fuzzy logic is not part of PSOA semantics (yet). Therefore the degree element is not defined in the PSOA grammars, and the TruthValuedConnective line has no effect on those syntaxes. However, the subclass concept is not limited to PSOA, and I believe it would make sense to allow the degree element to occur on Subclass when PSOA and Deliberation are merged in the next version. Therefore it would make sense to me to not remove the line about TruthValuedConnective in 1.03-psoa.
The map attributes apply certain properties to formulas that are nested within the element on which they appear. For example, mapMaterial would affect a nested Implies, having the same effect as a material attribute on the Implies element. Because Subclass does not contain nested implications, the map attributes do not make sense on Subclass.
The justification for departing from the template of the Equal element concerning the line
Empty-datt.choice |=notAllowed
to become
Subclass-datt.choice |=empty
is as follows: There are no required attributes on the Subclass element. None of the formerly-default attributes (e.g. mapMaterial) are applicable to Subclass. Therefore the datt (default attributes) pattern is set to empty.
The changes to attribute module and stripe-skipping module look correct. In the latter case, a relaxed serialization instance should be tested where the sub and super edges are skipped.
Subclass is not yet implemented in Deliberation PSOA (while the PSOA presentation syntax supports it). The
<Subclass>
,<sub>
and<super>
elements will be added e.g.: