Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
dangtv committed Nov 27, 2019
1 parent f78273b commit 946a46c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/syntax.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h2 id="abbreviated-syntax">Abbreviated syntax</h2>

<h3 id="primary-key">Primary key</h3>

<p>BIRDS provides a shorthand syntax to declare primary key on relations.
<p>BIRDS provides a shorthand syntax to declare primary keys on relations.
Given a relation t(<strong>A</strong>, B, C), we can declare <strong>A</strong> as a primary key of t by:</p>

<div class="language-prolog highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">PK</span><span class="p">(</span><span class="ss">t</span><span class="p">,[</span><span class="nv">A</span><span class="p">]).</span>
Expand All @@ -87,9 +87,9 @@ <h3 id="primary-key">Primary key</h3>
</code></pre></div></div>
<p>That is an abbreviation for the following rules:</p>

<div class="language-prolog highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="err">%</span> <span class="ss">for</span> <span class="ss">the</span> <span class="ss">functional</span> <span class="ss">dependency</span> <span class="nv">A</span><span class="p">,</span><span class="nv">B</span> <span class="o">-&gt;</span> <span class="nv">C</span><span class="o">:</span>
<div class="language-prolog highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="err">%</span> <span class="ss">for</span> <span class="ss">the</span> <span class="ss">functional</span> <span class="ss">dependency</span> <span class="p">(</span><span class="nv">A</span><span class="p">,</span><span class="nv">B</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nv">C</span><span class="o">:</span>
<span class="nv">_</span><span class="p">|</span><span class="nv">_</span> <span class="p">:-</span> <span class="ss">s</span><span class="p">(</span><span class="nv">A</span><span class="p">,</span><span class="nv">B</span><span class="p">,</span><span class="nv">C1</span><span class="p">,</span><span class="nv">_</span><span class="p">),</span> <span class="ss">s</span><span class="p">(</span><span class="nv">A</span><span class="p">,</span><span class="nv">B</span><span class="p">,</span><span class="nv">C2</span><span class="p">,</span><span class="nv">_</span><span class="p">),</span> <span class="ss">not</span> <span class="nv">C1</span> <span class="o">=</span> <span class="nv">C2</span><span class="p">.</span>
<span class="err">%</span> <span class="ss">for</span> <span class="ss">the</span> <span class="ss">functional</span> <span class="ss">dependency</span> <span class="nv">A</span><span class="p">,</span><span class="nv">B</span> <span class="o">-&gt;</span> <span class="nv">D</span><span class="o">:</span>
<span class="err">%</span> <span class="ss">for</span> <span class="ss">the</span> <span class="ss">functional</span> <span class="ss">dependency</span> <span class="p">(</span><span class="nv">A</span><span class="p">,</span><span class="nv">B</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nv">D</span><span class="o">:</span>
<span class="nv">_</span><span class="p">|</span><span class="nv">_</span> <span class="p">:-</span> <span class="ss">s</span><span class="p">(</span><span class="nv">A</span><span class="p">,</span><span class="nv">B</span><span class="p">,</span><span class="nv">_</span><span class="p">,</span><span class="nv">D1</span><span class="p">),</span> <span class="ss">s</span><span class="p">(</span><span class="nv">A</span><span class="p">,</span><span class="nv">B</span><span class="p">,</span><span class="nv">_</span><span class="p">,</span><span class="nv">D2</span><span class="p">),</span> <span class="ss">not</span> <span class="nv">D1</span> <span class="o">=</span> <span class="nv">D2</span><span class="p">.</span>
</code></pre></div></div>

Expand Down
6 changes: 3 additions & 3 deletions webpage/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In general, the verification in BIRDS is sound. BIRDS guarantees the completenes

### Primary key

BIRDS provides a shorthand syntax to declare primary key on relations.
BIRDS provides a shorthand syntax to declare primary keys on relations.
Given a relation t(**A**, B, C), we can declare **A** as a primary key of t by:

```prolog
Expand All @@ -54,8 +54,8 @@ PK(t,[A,B]).
That is an abbreviation for the following rules:

```prolog
% for the functional dependency A,B -> C:
% for the functional dependency (A,B) -> C:
_|_ :- s(A,B,C1,_), s(A,B,C2,_), not C1 = C2.
% for the functional dependency A,B -> D:
% for the functional dependency (A,B) -> D:
_|_ :- s(A,B,_,D1), s(A,B,_,D2), not D1 = D2.
```

0 comments on commit 946a46c

Please sign in to comment.