Skip to content
Permalink
Browse files

Fix steadfasness issue in the `difflist::flatten/2` library predicate

  • Loading branch information...
pmoura committed Mar 15, 2019
1 parent 5afc28c commit 1084630b23b2e678859c44ca58cedb6cf42ae641
Showing with 14 additions and 12 deletions.
  1. +2 −2 docs/_sources/difflist_0.rst.txt
  2. +1 −1 docs/_sources/index.rst.txt
  3. +2 −2 docs/difflist_0.html
  4. +1 −1 docs/index.html
  5. +8 −6 library/difflist.lgt
@@ -9,8 +9,8 @@
Difference list predicates.

| **Author:** Paulo Moura
| **Version:** 1.16
| **Date:** 2019/3/8
| **Version:** 1.17
| **Date:** 2019/3/15

| **Compilation flags:**
| ``static, context_switching_calls``
@@ -17,4 +17,4 @@ Indices and tables
* :ref:`genindex`
* :ref:`search`

Generated on Fri Mar 15 14:59:37 WET 2019
Generated on Fri Mar 15 16:39:47 WET 2019
@@ -313,8 +313,8 @@ <h1><code class="docutils literal notranslate"><span class="pre">difflist</span>
<p>Difference list predicates.</p>
<div class="line-block">
<div class="line"><strong>Author:</strong> Paulo Moura</div>
<div class="line"><strong>Version:</strong> 1.16</div>
<div class="line"><strong>Date:</strong> 2019/3/8</div>
<div class="line"><strong>Version:</strong> 1.17</div>
<div class="line"><strong>Date:</strong> 2019/3/15</div>
</div>
<div class="line-block">
<div class="line"><strong>Compilation flags:</strong></div>
@@ -2860,7 +2860,7 @@ <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Pe
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
</ul>
<p>Generated on Fri Mar 15 14:59:37 WET 2019</p>
<p>Generated on Fri Mar 15 16:39:47 WET 2019</p>
</div>


@@ -23,9 +23,9 @@
extends(compound)).

:- info([
version is 1.16,
version is 1.17,
author is 'Paulo Moura',
date is 2019/03/08,
date is 2019/03/15,
comment is 'Difference list predicates.',
see_also is [list, list(_), numberlist, varlist]
]).
@@ -96,12 +96,14 @@
flatten(List-Back, Flatted-Back) :-
flatten(List-Back, Back-Back, Flatted-Back).

flatten(Var, Tail-Back, [Var| Tail]-Back) :-
flatten(Var, Tail-Back, Flatted) :-
var(Var),
!.
flatten(List-Back, Flatted, Flatted) :-
!,
Flatted = [Var| Tail]-Back.
flatten(List-Back, Acc, Flatted) :-
List == Back,
!.
!,
Flatted = Acc.
flatten(List-Back, Acc, Flatted) :-
!,
List \== Back,

0 comments on commit 1084630

Please sign in to comment.
You can’t perform that action at this time.