Browse Source

Fix for metamodelling documentation

Yentl Van Tendeloo 3 years ago
parent
commit
4633945179
1 changed files with 8 additions and 7 deletions
  1. 8 7
      doc/metamodelling.rst

+ 8 - 7
doc/metamodelling.rst

@@ -95,13 +95,14 @@ Other attributes that can be set on classes are:
 1. *lower_cardinality* specifies the number (integer) of instances that must at least exist of this element.
 2. *upper_cardinality* specifies the number (integer) of instances that must at most exist of this element.
 3. *constraint* specifies additional constraints on the instances of this class.
+4. *abstract* specifies whether the class is to be abstract or not.
 
 For associations, we have the same three attributes, augmented with:
 
-4. *source_lower_cardinality* specifies the number (integer) of incoming edges that are at least required for the target.
-5. *source_upper_cardinality* specifies the number (integer) of incoming edges that are at most required for the target.
-6. *target_lower_cardinality* specifies the number (integer) of outgoing edges that are at least required for the source.
-7. *target_upper_cardinality* specifies the number (integer) of outgoing edges that are at most required for the source.
+5. *source_lower_cardinality* specifies the number (integer) of incoming edges that are at least required for the target.
+6. *source_upper_cardinality* specifies the number (integer) of incoming edges that are at most required for the target.
+7. *target_lower_cardinality* specifies the number (integer) of outgoing edges that are at least required for the source.
+8. *target_upper_cardinality* specifies the number (integer) of outgoing edges that are at most required for the source.
 
 Constraints
 ^^^^^^^^^^^
@@ -112,7 +113,7 @@ We distinguish between two types of constraints: local and global constraints.
 Local constraints are defined at the level of a single class or association.
 For example, if the number of tokens must always be non-negative, this can be specified as follows::
 
-    >>> attr_assign_code("formalisms/PetriNets", "Place", "constraints", \
+    >>> attr_assign_code("formalisms/PetriNets", "Place", "constraint", \
     ...     """
     ...     String function constraint(model : Element, name : String):
     ...         if (integer_gte(read_attribute(model, name, "tokens"), 0)):
@@ -165,7 +166,7 @@ The attribute type must be constrained::
     ...     """
     ...     String function constraint(value : Element):
     ...         if (is_physical_integer(value)):
-    ...             if (integer_geq(value, 0)):
+    ...             if (integer_gte(value, 0)):
     ...                 return "OK"!
     ...             else:
     ...                 return "Not a positive value"!
@@ -181,4 +182,4 @@ This can be easily done as follows::
 
     >>> define_attribute("formalisms/PetriNets", "Place", "tokens", "Natural")
 
-For the name, *String* can be defined similarly (using *is_physical_string*).
+For the name, *String* can be defined similarly (using *is_physical_string* and omitting the check greater than 0).