S-rule

From UNL Wiki
(Difference between revisions)
Jump to: navigation, search
(When to use S-rules)
(Properties)
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''S-rule''' (syntactic rule) is the formalism used for describing syntactic structures and syntactic operations in the UNL<sup>arium</sup> framework.
+
'''S-rule''' (syntactic/semantic rule) is a specific type of [[transformation rule]] used for dealing with [[syntactic relations]] and [[semantic relations]] in the UNL framework.
 +
 
 
== When to use S-rules ==
 
== When to use S-rules ==
S-rules are used for:
+
S-rules are used for altering, replacing, creating and deleting non-linear relations.
*[[composition]], i.e., creating compounds out of the [[base form]]s (such as "take">"take into account");
+
*[[periphrasis]], i.e., generating analytic grammatical structures, such as in ("love">"will love")
+
*[[subcategorization]], i.e., defining the number and the type of arguments of a given [[base form]];
+
*[[case marking]], i.e., defining the grammatical cases of the arguments of a given [[base form]];
+
*[[agreement]], i.e., concord between different parts of a phrase;
+
*[[distribution]], i.e., defining the precedence of word forms;
+
*[[adjacency]], i.e., defining the distance between syntactic branches;
+
*[[projection]], i.e., projecting syntactic structures out of the constituents;
+
*[[movement]], i.e., moving nodes and branches to different places in the syntactic structure; and
+
*[[mapping]], i.e., defining correspondences between semantic relations and syntactic relations.
+
  
 
== When not to use S-rules ==
 
== When not to use S-rules ==
S-rules are not used for for affixation (prefixation, infixation, suffixation) or for changes that involve only sequences of words, which must be addressed by [[A-rule]]s and [[L-rule]]s, respectively.
+
S-rules are not used for for linear relations (such as affixation, string manipulation and list manipulation, which must be addressed by [[A-rule]]s, [[N-rule]]s and [[L-rule]]s, respectively).
  
 
== Types of S-rules ==
 
== Types of S-rules ==
There are four types of S-rules:
+
{{:Transformation over relations}}
;Change
+
<CONDITION> := <RELATION>;
+
:Change the attributes of the constituents of the relation. The relation itself is not affected. Features are added through "+" and deleted through "-".
+
:*VA(%head;%adjt):=VA(%head,+C;%adj,-D); (add the feature C to the head and remove the feature D from the adjunct)
+
;Create
+
<CONDITION> := +<RELATION>;
+
:Create a new relation. Nodes to be created must be defined as strings (between quotes) or lemmas (between brackets), if not co-indexed to an existing node.
+
:*VA(%head;%adjt):=+VC(%head;"c"); (add the relation VC between the head and "c", which is created.)
+
;Delete
+
<CONDITION> := -<RELATION>;
+
:Delete a relation between the head and the argument. The head and the argument are not deleted.
+
:*VA(%head;%adjt):=-VA(%head;%adjt); (delete the relation VA between the head and its arguments. The nodes are not deleted)
+
;Replace
+
<RELATION> := <RELATION>;
+
:Replace the relation in the left side by the one in the right side
+
:*VA(%head;%any):=VC(%head;%any); (replace the relation VA by VC)
+
:Two special cases of replacement are
+
:;Merge: <RELATION><RELATION> := <RELATION>;
+
::Replace the relations in the left side by the ones in the right side.
+
::*VA(%head;%adjt)VC(%head;%comp):=VB(VB(%head;%adjt);%comp); (VA and VC are deleted, and VB is created)
+
:;Divide: <RELATION> := <RELATION><RELATION>;
+
::Replace the relation in the left side by those in the right side.
+
::*VA(%head;%adjt):=VC(%head;%x)VC(%head;%y); (VC is deleted, and the two VAs are created)
+
 
+
Where:<br/>
+
*<CONDITION> (to be repeated 0 or more times) may be a [[Tagset|tag]] or a <RELATION> that defines when the rule is applied. It may be empty in general cases (i.e., if the rule is always applied).
+
*<RELATION> (to be repeated 1 or more times) may be:
+
**a [[Syntactic roles|syntactic relation]] containing the <HEAD>, in case of head-only relations (VH, NH, JH, PH, IH, CH, AH, DH), or the <HEAD> and <ARGUMENT> (i.e, complement, adjunct or specifier), in case of binary relations (VA, VC, VS, VB, NA, NC, NS, etc).
+
**a [[relation|semantic relation]], containing the <SOURCE> and the <TARGET>;
+
*<HEAD>, <ARGUMENT>, <SOURCE> and <TARGET> may be expressed as
+
**a "string" (strings come between parentheses);
+
**a [lemma] (lemmas come between square brackets);
+
**a feature or a set of features, separated by comma, and extracted from the [[Tagset|UNDLF Tagset]];
+
**an [[#Indexes|index]];
+
**an action, to be performed by adding features (through "+"), deleting features (through "-"), or through the right side of an [[A-rule]] (i.e., prefixation, suffixation, infixation); or
+
**a <RELATION> itself (i.e., rules may be recursive).
+
  
== Observations ==
+
== Properties ==
;The <CONDITION> field may be empty in change, create and delete rules, in case of unconditional change, creation or deletion. It is obligatory in replace rules:
+
#S-rules always end in ";"
:*VA(+C); (add the feature C to all adjuncts to the head in the verbal phrase)
+
#*rel("a");
:*+VA("a"); (add an adjunct "a" to the head of the verbal phrase, whatever the case)
+
#*<strike>rel("a")</strike>
:*-VA(C); (delete all adjuncts to the head of the verbal phrase that have the feature C)
+
#Relations are n-ary, i.e., they may have as many arguments as necessary, isolated by semicolon (";")
;The <HEAD> and the <ARGUMENT> may be empty in case of no change. Empty heads are automatically extended:
+
#*rel("a"); (relation with one argument)
:Binary relations (?A, ?S, ?C)
+
#*rel("a";"b"); (relation with two arguments)
:*VA(); (no head nor argument: the relation is automatically extended to "VA(;);" )
+
#*rel("a";"b";"c"); (relation with three arguments)
:*VA(;); (same as above)
+
#*etc.
:*VA("a"); (argument only: the relation is automatically extended to "VA(;"a");" )
+
#:Syntactic relations are not predefined, although we have been using a set of binary relations based on the [[syntactic relations|X-bar theory]].
:*VA("a";); (head only)
+
#:Semantic relations constitute a predefined and closed set that can be found [[Universal Relations|here]].
:*VA("a";"b"); (head and argument)
+
#Inside each relation, nodes may be referenced by any of its elements, isolated by comma (,):
:Unary relations (?H)
+
#:VC(%a;%b) - syntactic relation between a node where index = %a and another node where index = %b
:*VH(); (no head)
+
#:agt("a",[a],<nowiki>[[a]]</nowiki>,A;"b",[b],<nowiki>[[b]]</nowiki>,B) - semantic relation between a node having the feature A where string = "a" AND headword <nowiki>[a]</nowiki> AND UW = <nowiki>[[a]]</nowiki> AND another node having the feature B where string = "b" AND headword = [b] AND UW = <nowiki>[[b]]</nowiki>
:*VH("a"); (head)
+
#The arguments of a relation may be empty in case they are not affected by S-rules.
;Relations are always juxtaposed (they must not be separated by ",")
+
#:rel(;):=rel2(;); (replace all relations rel by rel2, regardless of their arguments)
:VS("b")VC("c")VA("d");
+
#Relations may be conjoined through juxtaposition:
:<strike>VS("b"),VC("c"),VA("d");</strike>
+
#:agt(%x;%y)obj(%x;%z) - two semantic relations: one between (%x) and (%y) AND other between (%x) and (%z)
;Order is not important between relations, but essential between constituents of the same relation
+
#:<strike>VC([a];[b]),VC([a];[c])</strike> - conjoined relations must not be isolated by comma
:VS("b")VC("c")VA("d") = VC("c")VA("d")VS("b") = VA("d")VC("c")VS("b")
+
#Relations may be disjoined through {braces}
:VA("a";"b"); '''&ne;''' VA("b";"a");
+
#:{("a")|("b")}("c") - either ("a")("c") or ("b")("c")
;Arguments of relations may be expressed by [[A-rule]]s, but only in the right side of rules  
+
#:{agt(%x;%y)|exp(%x;%y)}obj(%x;%z) - either agt(%x;%y)obj(%x;%z) or exp(%x;%y)obj(%x;%z)
:VA(0>"a"); (the verbal adjuncts, if any, receive an "a" as suffix)
+
#Order is not important between relations, but essential between arguments of the same relation
;Rules are conservative. Features will be preserved unless explicitly deleted (through "-")
+
#:rel1("b")rel2("c")rel3("d") = rel2("c")rel3("d")rel1("b") = rel3("d")rel2("c")rel1("b")
:VC(%comp,ACC):=VC(%comp,NOM); (is the same as "VC(%comp,ACC):=VC(%comp,+NOM);" i.e., add the feature "NOM" to the complements of verb that have the feature "ACC"; the feature "ACC" will be preserved and not replaced by "NOM")
+
#:rel1("a";"b"); '''&ne;''' rel1("b";"a");
:VC(%comp,%ACC):=VC(%comp,NOM,-ACC); (add the feature "NOM" and delete the feature "ACC" from the complements of the verb that have the feature "ACC")
+
#Relations may be replaced by regular expressions
;Features and strings should not be repeated in the right side except in case of deletion or change. Indexes may be repeated for clarity.
+
#:/.{2,3}/(%x;%y) - any relation made of two or three characters between %x and %y
:VC(%comp,ACC):=VC(%comp,+NOM); (the feature "ACC" should not be repeated in the right side of the rule)
+
#Arguments of relations may be expressed by [[A-rule]]s, but only in the right side of rules  
:VC(%comp,"a"):=VC(%comp,+NOM); (the string "a" should not be repeated in the right side of the rule)
+
#:rel("a"):=rel("an"); or rel("a"):=rel(0>"n");
;A node may have as many features as necessary, but one single string or lemma
+
#S-rules do not affect nodes unless explicitly informed
:VC(%comp,"a"):=VC(%comp,"b"); ("a" is replaced by "b")
+
#:rel("a",[a],[[a]],A,%x;"b",[b],<nowiki>[[b]]</nowiki>,B,%y):=rel2(%x;%y); (the nodes %x and %y do not undergo any change)
;Strings are represented between quotes if invariable, or between brackets if variable (lemmas)
+
#:rel("a",[a],[[a]],A,%x;"b",[b],<nowiki>[[b]]</nowiki>,B,%y):=rel2(%x); (the node %x does not undergo any change; the node %y is deleted)
:VA("into account"); (the string "into account" is an adjunct to the verb)
+
#:rel("a",[a],[[a]],A,%x;"b",[b],<nowiki>[[b]]</nowiki>,B,%y):=rel2(%x,-A;%y); (the feature A is removed from the node %x; all the rest, including the node %y, does not undergo any change)
:IH([be]); (the lemma "be" is the head of inflectional phrase)
+
#"^" is used for negation
;Negation
+
#:rel1(%x;%y)^rel2(%y;%z):=+rel2(%y;%z); (if there is a rel1 between the nodes %x and %y and there is no relation rel2 between the nodes %y and %z, create a new relation rel2 between the nodes %y and %z)
:"^" is used for negation, and may be applied over features, strings or relations:
+
:*VA(^NOU); (if the adjunct does not have the feature "NOU")
+
:*VA(^"a"); (if the adjunct is not the string "a")
+
:*^VA("a"); (if there is no VA relation between the head and "a")
+
;S-rules always end in ";"
+
:*VA("a");
+
:*<strike>VA("a")</strike>
+
  
 
== Indexes ==
 
== Indexes ==
;Nodes are always indexed in S-rules
+
See [[Indexation]]
:Indexes (%) are used for indexing nodes, attributes and values inside and between the left (condition) and the right side of rules.
+
:*X('''%a''';'''%b''')Y('''%a''';'''%c'''); (the head of X is also the head of Y)
+
;Indexes as variables
+
:Indexes are features and may be used as variables
+
:*X('''%a''';'''%b''')Y('''%a''';'''%c'''):=Z('''%b''';'''%c'''); (if the head of the relation X is the head of the relation Y, delete X and Y and create Z between the arguments of X and Y)
+
:*X('''%a''',A;'''%b''',B):=X('''%a''';'''%b''',+C,-B); (add the feature C to the argument of X and remove the feature B from it if the head of X has the feature A)
+
;If omitted, indexes are assigned by default, according to the position:
+
:*X(A;B)Y(C;D)Z(E;F); is the same as X(A,'''%01''';B,'''%02''')Y(C,'''%03''';D,'''%04''')Z(E,'''%05''';F,'''%06''');
+
:*X(A;B):=X(;+C,-B); is the same as X(A,'''%01''';B,'''%02'''):=X('''%01''';+C,-B,'''%02''');
+
:*X(A;B):=X(+C,-B); is the same as X(A,'''%01''';B,'''%02'''):=X('''%01''';+C,-B,'''%02'''); (same as above: the relation is automatically extended if the head is empty)
+
:However
+
:*X(A;B)Y(A;C):=Z(B;C); is different from X(%a;%b)Y(%a;%c):=Z(%b;%c);
+
:**X(A;B)Y(A;C):=Z(B;C); is the same as X(A,'''%01''';B,'''%02''')Y(A,'''%03''';C,'''%04'''):=Z(B,'''%01''';C,'''%02''');  while
+
:**X(A,%a;B,%b)Y(A,%a;C,%c):=Z(B,%b;C,%c); is the same as X(A,'''%01''';B,'''%02''')Y(A,'''%01''';C,'''%04'''):=Z(B,'''%02''';C,'''%04''');
+
::In the first case, the feature B is added to the head of X and the feature C is added to its argument; the relation Y is deleted. In the second case, the feature C is added to the argument of Y, and Z is made between the arguments of X and Y>
+
;If omitted, right side indexes are automatically co-indexed with the left side ones:
+
:*X(;):=Y(;); is the same as X('''%01''';'''%02'''):=Y('''%01''';'''%02''');
+
;Right side indexes are to explicitly defined if order is to be altered:
+
:*X(;):=Y(%02;%01);
+
;Indexes can be replaced by user-defined labels made of any sequence of alphabetic characters and underscore:
+
:X(A,%a;B,%b)Y(C,%c;D,%d)Z(E,%e;F,%f)
+
::%01 = A, %02 = B, %03 = C, %04 = D, %05 = E, %06 = F and
+
::%a = A, %b = B, %c = C, %d = D, %e = E, %f = F
+
;Numeric characters cannot be used as user-defined indexes:
+
:X(A,%03;B,%05)
+
::%01 = A, %02 = B (there is no %03 nor %05)
+
;To avoid ambiguities, users are strongly recommended to replace default values by customized labels:
+
:*X(A,%a;B,%b)
+
::instead of simply X(A;B) or X(A,%01;B,%02)
+
;In case of sub-nodes, the parent node must be informed by the syntax <PARENT NODE><CHILD NODE>, where <PARENT NODE> may be, itself, a sub-node:
+
:X(Y(A;B);C)
+
::%01 = Y(A;B), %02 = C, %01%01 = A, %01%02 = B
+
:X(Y(Z(A;B);C);D)
+
::%01 = Y(Z(A;B);C), %02 = D, %01%01 = Z(A;B), %01%02 = C, %01%01%01 = A, %01%01%02 = B
+
;Indexation is not affected by repetition:
+
:X(A;B)Y(A;C)Z(A;D)
+
::%01 = A, %02 = B, %03 = A, %04 = C, %05 = A, %06 = D (and %01 = %03 = %05)
+
;Empty nodes are also indexed:
+
:X(;)
+
::%01 = first node of X, %02 = second node of X
+
;Indexes may be used both in the left and in the right side of rules:
+
:X(%a;%b):=Y(%b;%a); (the first node of the X relation becomes the second node of the Y relation)
+
:X(%a;)Y(%a;):=Z(%a); (if the first node of the X relation is the first node of the Y relation then make it the single node of a Z relation)
+
;Indexes may also be used to transfer attribute values expressed in the format ATTRIBUTE=VALUE:
+
:X(A,%a,ATT1=VAL1;B,%b):=X(%a;%b,ATT1=%a); (the value "VAL1" of "ATT1" of %a is copied to the node %b)
+
  
 
== Examples ==
 
== Examples ==
 
Examples of S-rules:
 
Examples of S-rules:
 
*composition
 
*composition
**VA("into account"); (add the string "into account" as the adjunct of the verb)
+
**VA("into account",PP); (add the PP "into account" as the adjunct of the verb)
 
*subcategorization
 
*subcategorization
**VC(PH("in")); (the complement of the verb is a prepositional phrase headed by the preposition "in")
+
**VC(PH([in])); (the complement of the verb is a prepositional phrase headed by the preposition "in")
 
*agreement
 
*agreement
 
**VS(ANUM,APER); (the specifier of the verb assigns number (ANUM) and person (APER) to its head
 
**VS(ANUM,APER); (the specifier of the verb assigns number (ANUM) and person (APER) to its head
Line 170: Line 73:
 
S-rules comply with the following formal syntax:  
 
S-rules comply with the following formal syntax:  
  
  <<nowiki>S-RULE</nowiki>>                ::= <CONDITION> ":=" (<SYNTACTIC RELATION>)+";"
+
  <<nowiki>S-RULE</nowiki>>                ::= <CONDITION> ":=" (<RELATION>)+";"
  <CONDITION>            ::= <TAG>(","<TAG>)* | (<SYNTACTIC RELATION>)*
+
  <CONDITION>            ::= <TAG>(","<TAG>)* | (<RELATION>)*
  <SYNTACTIC RELATION>    ::= <HEAD-DRIVEN RELATION> "(" (<NODE>";")? <NODE> ")"
+
<RELATION>              ::= <SYNTACTIC RELATION> | <SEMANTIC RELATION>
  <HEAD-DRIVEN RELATION>  ::= {one of the head-driven syntactic relations defined in the [[Tagset|UNDLF Tagset]]}  
+
<SEMANTIC RELATION>    ::= <UNL RELATION> "(" <NODE> ";" <NODE> ")"
 +
  <SYNTACTIC RELATION>    ::= <NL RELATION> "(" (<NODE>";")? <NODE> ")"
 +
  <UNL RELATION>         ::= {one of the head-driven semantic relations defined in the [[Universal Relations|UNL Specs]]}  
 +
<NL RELATION>          ::= {one of the head-driven syntactic relations defined in the [[Tagset|UNDLF Tagset]]}  
 
  <NODE>                  ::= <FEATURE>(","<FEATURE>)*  
 
  <NODE>                  ::= <FEATURE>(","<FEATURE>)*  
 
  <FEATURE>              ::= <ID>|<TAG>|"""<STRING>"""|"["<STRING>"]"|<DIRECTION>|<SYNTACTIC RELATION>|<ACTION>
 
  <FEATURE>              ::= <ID>|<TAG>|"""<STRING>"""|"["<STRING>"]"|<DIRECTION>|<SYNTACTIC RELATION>|<ACTION>

Latest revision as of 18:33, 24 June 2014

S-rule (syntactic/semantic rule) is a specific type of transformation rule used for dealing with syntactic relations and semantic relations in the UNL framework.

Contents

When to use S-rules

S-rules are used for altering, replacing, creating and deleting non-linear relations.

When not to use S-rules

S-rules are not used for for linear relations (such as affixation, string manipulation and list manipulation, which must be addressed by A-rules, N-rules and L-rules, respectively).

Types of S-rules

Relations are altered, replaced, created and deleted by S-rules:

Altering nodes in a relation

Elements of nodes in relations are altered through the operators + (add) and - (delete). The operator + may be omitted.

  • rel(%x,A;%y,B):=rel(%x,+C;%y,+D); (add the feature C to %x and D to %y)
  • rel(%x,A;%y,B):=rel(%x,C;%y,D);(the same as above)
  • rel(%x,A;%y,B):=rel(%x,-A;%y); (delete the feature A from %x)

"strings", [headwords] and [[UWs]] are considered to be features (but a single node may have only one of each)

  • rel(%x;%y):=rel(%x,"a";%y); (replace the existing string in %x, if any, by "a")
  • rel(%x;%y):=rel(%x,[A];%y);(replace the existing headword in %x, if any, by [A])
  • rel(%x;%y):=rel(%x,[[A]];%y); (replace the existing UW in %x, if any, by [[A]])

Creating nodes in a relation

Nodes are created when they are not co-indexed to any node in the left side (see Indexation):

  • rel(%x,A;%y,B):=rel(%x;%y;%z,+A); (the node %z, with the feature A, is created as a new argument of the relation rel)

Deleting nodes in a relation

Nodes are deleted when they are not co-indexed to any node in the right side (see Indexation):

  • rel(%x,A;%y,B;%z,C):=rel(%x;%y); (the node %z is deleted as an argument of the relation rel)

Nodes are completelly deleted if, and only if, they are not part of any other relation

Creating relations

Relations are created by the operator + (add) before the relation to be created. This operator may not be omitted.

  • rel(%x;%y):=+rel2(%x;%z); (a new relation rel2 is created between the nodes %x and %z; the original relation is not altered)

Creation of relations is a possible source of infinite loops. In order to prevent the rule from applying eternally, the condition field must be controlled:

  • rel(%x;%y)^rel2(%x;%z):=+rel2(%x;%z);

Deleting relations

Relations are deleted when they are not repeated in the right side, except in case of +

  • rel(%x;%y):=; (the relation rel between the nodes %x and %y is deleted)
  • rel(%x;%y):=rel2(%x;%y); (the relation rel between %x and %y is deleted and a new relation rel2 is created in its place) (replacement)
  • rel(%x;%y):=+rel2(%x;%y); (the relation rel is preserved and a new relation rel2 is created) (creation)

Replacing relations

Relations in the left side are replaced by relations in the right side, except in case of +:

  • rel(%x;%y):=rel2(%x;%y); (the relation rel between %x and %y is deleted and a new relation rel2 is created in its place)
  • rel1(%x;%y)rel2(%y;%z):=rel3(%x;%z); (the relations rel1 and rel2 are deleted and a new relation rel3 is created in their place) (merge)
  • rel(%x;%y):=rel1(%x;%y)rel2(%y;%z); (the relation rel is deleted and two new relations rel1 and rel2 are created in its place) (divide)
  • (%x)(%y):=rel(%x;%y); (the linear relation between the nodes %x and %y is replaced by the non-linear relation rel between the same nodes)
  • L(%x;%y):=rel(%x;%y); (the same as above)

Properties

  1. S-rules always end in ";"
    • rel("a");
    • rel("a")
  2. Relations are n-ary, i.e., they may have as many arguments as necessary, isolated by semicolon (";")
    • rel("a"); (relation with one argument)
    • rel("a";"b"); (relation with two arguments)
    • rel("a";"b";"c"); (relation with three arguments)
    • etc.
    Syntactic relations are not predefined, although we have been using a set of binary relations based on the X-bar theory.
    Semantic relations constitute a predefined and closed set that can be found here.
  3. Inside each relation, nodes may be referenced by any of its elements, isolated by comma (,):
    VC(%a;%b) - syntactic relation between a node where index = %a and another node where index = %b
    agt("a",[a],[[a]],A;"b",[b],[[b]],B) - semantic relation between a node having the feature A where string = "a" AND headword [a] AND UW = [[a]] AND another node having the feature B where string = "b" AND headword = [b] AND UW = [[b]]
  4. The arguments of a relation may be empty in case they are not affected by S-rules.
    rel(;):=rel2(;); (replace all relations rel by rel2, regardless of their arguments)
  5. Relations may be conjoined through juxtaposition:
    agt(%x;%y)obj(%x;%z) - two semantic relations: one between (%x) and (%y) AND other between (%x) and (%z)
    VC([a];[b]),VC([a];[c]) - conjoined relations must not be isolated by comma
  6. Relations may be disjoined through {braces}
    {("a")|("b")}("c") - either ("a")("c") or ("b")("c")
    {agt(%x;%y)|exp(%x;%y)}obj(%x;%z) - either agt(%x;%y)obj(%x;%z) or exp(%x;%y)obj(%x;%z)
  7. Order is not important between relations, but essential between arguments of the same relation
    rel1("b")rel2("c")rel3("d") = rel2("c")rel3("d")rel1("b") = rel3("d")rel2("c")rel1("b")
    rel1("a";"b"); rel1("b";"a");
  8. Relations may be replaced by regular expressions
    /.{2,3}/(%x;%y) - any relation made of two or three characters between %x and %y
  9. Arguments of relations may be expressed by A-rules, but only in the right side of rules
    rel("a"):=rel("an"); or rel("a"):=rel(0>"n");
  10. S-rules do not affect nodes unless explicitly informed
    rel("a",[a],a,A,%x;"b",[b],[[b]],B,%y):=rel2(%x;%y); (the nodes %x and %y do not undergo any change)
    rel("a",[a],a,A,%x;"b",[b],[[b]],B,%y):=rel2(%x); (the node %x does not undergo any change; the node %y is deleted)
    rel("a",[a],a,A,%x;"b",[b],[[b]],B,%y):=rel2(%x,-A;%y); (the feature A is removed from the node %x; all the rest, including the node %y, does not undergo any change)
  11. "^" is used for negation
    rel1(%x;%y)^rel2(%y;%z):=+rel2(%y;%z); (if there is a rel1 between the nodes %x and %y and there is no relation rel2 between the nodes %y and %z, create a new relation rel2 between the nodes %y and %z)

Indexes

See Indexation

Examples

Examples of S-rules:

  • composition
    • VA("into account",PP); (add the PP "into account" as the adjunct of the verb)
  • subcategorization
    • VC(PH([in])); (the complement of the verb is a prepositional phrase headed by the preposition "in")
  • agreement
    • VS(ANUM,APER); (the specifier of the verb assigns number (ANUM) and person (APER) to its head
  • case marking
    • VS(NOM); (the specifier of the verb receives the case nominative (NOM)
  • distribution
    • VA(>>); (the adjunct of the verb comes at the right side of the verb after a blank space)
  • adjacency
    • VA(AJ2); (the adjunct of the verb integrates the second projection of the head)
  • periphrasis
    • VH(%vh,FUT):=+IC([will];%vh,+INF);
  • projection
    • VS(%head;%spec)VB(%head;%comp):=VP(VB(%head;%comp);%spec); (integrate the two relations on the left side into a single relation)
  • mapping
    • agt(%source;%target):=VS(%source;%target); (the agent relation is mapped into a VS relation)

Formal Syntax

S-rules comply with the following formal syntax:

<S-RULE>                ::= <CONDITION> ":=" (<RELATION>)+";"
<CONDITION>             ::= <TAG>(","<TAG>)* | (<RELATION>)*
<RELATION>              ::= <SYNTACTIC RELATION> | <SEMANTIC RELATION>
<SEMANTIC RELATION>     ::= <UNL RELATION> "(" <NODE> ";" <NODE> ")"
<SYNTACTIC RELATION>    ::= <NL RELATION> "(" (<NODE>";")? <NODE> ")"
<UNL RELATION>          ::= {one of the head-driven semantic relations defined in the UNL Specs}  
<NL RELATION>           ::= {one of the head-driven syntactic relations defined in the UNDLF Tagset} 
<NODE>                  ::= <FEATURE>(","<FEATURE>)* 
<FEATURE>               ::= <ID>|<TAG>|"""<STRING>"""|"["<STRING>"]"|<DIRECTION>|<SYNTACTIC RELATION>|<ACTION>
<ID>                    ::= "%"[a-zA-Z_0-9]+
<TAG>                   ::= {one of the tags defined in the UNDLF Tagset}
<STRING>                ::= [a..Z]+
<DIRECTION>             ::= ">"|">>"|"<"|"<<"
<ACTION>                ::= <PREFIXATION> | <SUFFIXATION> | <INFIXATION> | <REPLACEMENT> (cf. A-rule)

where
<a> = a is a non-terminal symbol
"a" = a is a constant
a | b = a or b
(a)? = a can be repeated 0 or one time
(a)* = a can be repeated 0 or more times
(a)+ = a can be repeated 1 or more times

Software