Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions tutorials/online/sidenote-multiplicity.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
<body>
<h2>Multiplicity Markings</h2>

<p>When defining a field of a signature to be a relation, you write something like this:</p>
<p>When defining a field of a signature to be a relation in itself as well , you write something like this:</p>

<pre><b>
sig University {
groupMember: Student -> Professor
}
</b></pre>

<p> Here, each University knows which student is a member of which
professor's research group. That is, there is a relation from
Universities to Students to Professors. By writing multiplicity
markings to the declaration of the relation, we can add additional
constraints in a concise way. For example, </p>
<p> Here, there is a (nameless) relation from Students to Professors, which is
in turn related to some university through the relation <i>groupMember</i>.

By writing multiplicity markings to the declaration of the relation,
we can add additional constraints in a concise way. For example, </p>

<pre><b>
sig University {
groupMember: Student -> one Professor
}
</b></pre>

<p> means that each student is in exactly one professor's research
<p> means that each student is in exactly <b>one</b> professor's research
group. If we instead wrote this,</p>

<pre><b>
Expand All @@ -36,17 +36,19 @@ <h2>Multiplicity Markings</h2>
}
</b></pre>

<p> Then we are saying that some students may be in no research group,
but no student is in more than one. Lastly, we can write</p>
<p> Then we are saying that every student is studying (related) with at most
one professor. Lastly, we can write</p>

<pre><b>
sig University {
groupMember: Student -> some Professor
}
</b></pre>

<p> to say that each student is in one or more research groups. When
no multiplicity markings are present, there are not
<p> to say that each student is in one or more research groups (since the student
can be related with <i>some</i> ie. one or more professors.

When no multiplicity markings are present, there are no
constraints.</p>

<hr WIDTH="50%">
Expand Down