And, Or take sets of Props
Remove redundant UniqueSym class.
Debug printing for Any, not AnyRef, to include primitives

Signed-off-by: Gerard Basler <gerard.basler@gmail.com>
Avoid the `CNF budget exceeded` exception via smarter translation into CNF.

The exhaustivity checks in the pattern matcher build a propositional
formula that must be converted into conjunctive normal form (CNF) in
order to be amenable to the following DPLL decision procedure.
However, the simple conversion into CNF via negation normal form and
Shannon expansion that was used has exponential worst-case complexity
and thus even simple problems could become untractable.

A better approach is to use a transformation into an _equisatisfiable_
CNF-formula (by generating auxiliary variables) that runs with linear
complexity. The commonly known Tseitin transformation uses bi-
implication. I have choosen for an enhancement: the Plaisted
transformation which uses implication only, thus the resulting CNF
formula has (on average) only half of the clauses of a Tseitin
transformation.

The Plaisted transformation uses the polarities of sub-expressions to
figure out which part of the bi-implication can be omitted. However,
if all sub-expressions have positive polarity (e.g., after
transformation into negation normal form) then the conversion is
rather simple and the pseudo-normalization via NNF increases chances
only one side of the bi-implication is needed.

I implemented only optimizations that had a substantial
effect on formula size:
- formula simplification, extraction of multi argument operands
- if a formula is already in CNF then the Tseitin/Plaisted
  transformation is omitted
- Plaisted via NNF
- omitted: (sharing of sub-formulas is also not implemented)
- omitted: (clause subsumption)
SI-7459 Handle pattern binders used as prefixes in TypeTrees.

Match translation was incorrect for:

    case t => new t.C
    case D(t) => new d.C

We would end up with Types in TypeTrees referring to the wrong
symbols, e.g:

    // t7459a.scala
    ((x0$1: this.LM) => {
      case <synthetic> val x1: this.LM = x0$1;
      case4(){
       matchEnd3(new tttt.Node[Any]())
      };
      matchEnd3(x: Any){
        x
    }

Or:
    // t7459b.scala
     ((x0$1: CC) => {
       case <synthetic> val x1: CC = x0$1;
       case4(){
         if (x1.ne(null))
           matchEnd3(new tttt.Node[Any]())
         else
           case5()
       };

This commit:

  - Changes `bindSubPats` to traverse types, as well as terms,
    in search of references to bound symbols
  - Changes `Substitution` to reuse `Tree#substituteSymbols` rather
    than the home-brew substitution from `Tree`s to `Tree`s, if the
    `to` trees are all `Ident`s
  - extends `substIdentsForTrees` to substitute selections like
    `x1.caseField` into types.

I had to dance around the awkward handling of "swatches" (exception
handlers that can be implemented with JVM native type switches) by
duplicating trees to avoid seeing the results of `substituteSymbols`
in `caseDefs` after we abandon that approach if we detect the
patterns are too complex late in the game.

I also had to add an escape hatch for the "type selection from
volatile type" check in the type checker. Without this, the
translation of `pos/t7459c.scala`:

    case <synthetic> val x1: _$1 = (null: Test.Mirror[_]).universe;
    case5(){
      if (x1.isInstanceOf[Test.JavaUniverse])
        {
          <synthetic> val x2: _$1 with Test.JavaUniverse = (x1.asInstanceOf[_$1 with Test.JavaUniverse]: _$1 with Test.JavaUniverse);
          matchEnd4({
            val ju1: Test.JavaUniverse = x2;
            val f: () => x2.Type = (() => (null: x2.TypeTag[Nothing]).tpe);

.. triggers that error at `x2.TypeTag`.
spec: Add a link to the sources from the main page
SI-8950  SeqView and StreamView allow indexing out of a slice

Added `idx >= 0` tests for `SeqViewLike#Sliced` `apply` and `mutable.IndexedSeqViewLike#Sliced` `unapply`.  Now you get `IndexOutOfBoundsException`s as you should.

No tests; this was found by collections-laws and will be tested by them.  (Exact variants in bug report were tested in the REPL.)
intellij module repl depends on asm
Merge pull request #4194 from lrytz/intellij-repl

intellij module repl depends on asm
Merge pull request #4154 from smarter/patch-1

spec: Add a link to the sources from the main page
Merge pull request #4192 from Ichoran/issue/8950

SI-8950  SeqView and StreamView allow indexing out of a slice
[nomerge] SI-9030 don't call private BoxesRunTime.equalsNumChar

When comparing a Number and a Character, the would emit a call to the
private method. For binary compatibility, this method remains private
in 2.11, so we just use equalsNumObject instead.
Merge pull request #4078 from gbasler/topic/fix-analysis-budget

Avoid the `CNF budget exceeded` exception via smarter translation into CNF.
SI-8999 Reduce memory usage in exhaustivity check

The OOM could occur when all models are forcibly expanded in the DPLL solver.

The simplest solution would be to limit the number of returned models but then
we are back in non-determinism land (since the subset we get back depends on
which models were found first).

A better alternative is to create only the models that have corresponding
counter examples.

If this does not ring a bell, here's a longer explanation:

TThe models we get from the DPLL solver need to be mapped back to counter
examples. However there's no precalculated mapping model -> counter example.
Even worse, not every valid model corresponds to a valid counter example.

The reason is that restricting the valid models further would for example
require a quadratic number of additional clauses. So to keep the optimistic case
fast (i.e., all cases are covered in a pattern match), the infeasible counter
examples are filtered later.

The DPLL procedure keeps the literals that do not contribute to the solution
unassigned, e.g., for  `(a \/ b)` only {a = true} or {b = true} is required and
the other variable can have any value. This function does a smart expansion of
the model and avoids models that have conflicting mappings.

For example for in case of the given set of symbols (taken from `t7020.scala`):
 "V2=2#16"
 "V2=6#19"
 "V2=5#18"
 "V2=4#17"
 "V2=7#20"

One possibility would be to group the symbols by domain but
this would only work for equality tests and would not be compatible
with type tests.

Another observation leads to a much simpler algorithm:
Only one of these symbols can be set to true,
since `V2` can at most be equal to one of {2,6,5,4,7}.

TODO: How does this fare with mixed TypeConst/ValueConst assignments?
When the assignments are e.g., V2=Int | V2=2 | V2=4, only the assignments
to value constants are mutually exclusive.
Suppress match analysis under -Xno-patmat-analysis

NoSuppression doesn't suppress. FullSuppression does.
Now using the latter when running under `-Xno-patmat-analysis`.

I should really have tested. /me hides under a rock
SI-8538 Test or example for Source.report

It's possible to supply an arbitrary `Positioner` to a
custom `Source` that wants to override `report`.

This obviates the need to expose the deprecated `Position` class.

The default report method consumes the underlying iterator, which
is not desirable and produces unexpected results.

The expected outcome is that no one uses or extends the legacy
position handling code.

In 2.12, use a Reporter instead, perhaps. The current API is
used by scala-xml's MarkupParser.
fix ByteCodecs scaladoc
SI-9043 ArrayBuffer.insert and insertAll are very slow

insert and insertAll were slower than their java equivalents by factors
of 5 and 10 respectively.

Benchmark code was provided here:
https://gist.github.com/rklaehn/3e9290118fcf63d1feae

We are using a toList to the source Traversable
Then doing a length and a copy on that collection.

By using an array, we can make use of faster methods.
Managed to get the ratios down to 1.5 and 1.5 respectively.

In addition to this, I think we should consider breaking insert into 2
separate methods, one for a single item and one for a collection.  The
varags version is very expensive when a single item is being inserted.

@phaller @axel22
Merge pull request #4203 from xuwei-k/ByteCodecs-scaladoc

fix ByteCodecs scaladoc
Merge pull request #4202 from kanielc/SI-9043

SI-9043 ArrayBuffer.insert and insertAll are very slow
SI-8538 Document extension

Scaladoc for report extension point.