[fix Subfunction.hs to work with wildcards
Helmut Grohne <grohne@cs.uni-bonn.de>**20150218133926
 Ignore-this: 1e2f0c2ead9bc68e7a5f5ef250ae59b4
 
 Since aunify can now handle wildcards, the subfunction introduction can fail to
 handle it. Consider two examples where one rhs is a wildcard and the other rhs
 is an applied constructor. aunify will now yield an applied constructor.
 abduceIOAt will now fail in fromJust, because the wildcard has no subterms.
 Instead, these subterms need to be generated as new sub-wildcards. Merely
 skipping such IO examples would be wrong, because examples with a wildcard rhs
 still can affect the lhs of a "fuse"d rule.
] 
<
[simplify isTuple and isAnyTuple without TemplateHaskell
Helmut Grohne <grohne@cs.uni-bonn.de>**20140717084230
 Ignore-this: 3bb9e59d15a53053c78df69001431229
] 
[work around unhandled runtime error passing by catchError
Helmut Grohne <grohne@cs.uni-bonn.de>**20140108073945
 Ignore-this: 60b21165b086517cb697ed19c7fe368e
] 
[use throwError where possible
Helmut Grohne <grohne@cs.uni-bonn.de>**20140108091026
 Ignore-this: e06ab5b6869087360b7a19fc56a8c2c4
 Since the use of fail changed in past GHC releases, part of the code base now
 uses throwError instead. The biggest part is the introduction of an Error e
 requirement to many of the functions to be able to use throwError. As a side
 effect of this change, interactive igor2 no longer dies on a syntax error.
] 
[simplify the data type Type
Helmut Grohne <grohne@cs.uni-bonn.de>**20150209153158
 Ignore-this: 7e09228772a1b15bc375449fc28502cf
 
 Remove constructors ArrowT, ListT and TupleT. These can also be represented as
 compositions of AppT and ConT. Re-define their lower-case constructors suitably
 and improve pretty-printing to cover for these cases.
] 
[improve pretty printing of wildcards
Helmut Grohne <grohne@cs.uni-bonn.de>**20150217143213
 Ignore-this: e0aa9284e9302ebdeaead04bfd53e064
 
 The current way of transforming TWildEs into TH.Exp, is not valid Haskell as an
 unbound identifier prefixed with a question mark is used. If a wildcard shows
 up in a final hypothesis, it cannot be compiled. Thus changing the
 representation of wildcards to calls of error with the wildcard name attached.
 
 While this is not relevant here, it becomes relevant once igor can create
 hypotheses containing wildcards.
] 
[Added tests
tobias@goedderz.info**20140716121419
 Ignore-this: 2921a28371ef1c3b5dc474a830f9c9a3
] 
[Updated test .out files to match the current behaviour
tobias@goedderz.info**20141229145445
 Ignore-this: 7e078cbbab9513e12647732973f44793
] 
[avoid duplicate partitioning
Helmut Grohne <grohne@cs.uni-bonn.de>**20150108162514
 Ignore-this: ae1ec4df2cbd0b2d11ebdd8fe1db2dc3
 
 In the partitioning step, a hypothesis can be partitioned at multiple
 variables. Different splits can produce the same generalized hypotheses on the
 given iodata. For example, if a function is given two lists and in all examples
 the length of both lists is equal, then splitting on each argument results in
 the same hypotheses. By not returning duplicate hypotheses, work may be saved
 in later iterations of the algorithm. Accordingly, a few tests run in fewer
 iterations and the enjoySport test no longer produces two identical hypotheses
 after this change.
] 
[set + simplify for all successful tests
Helmut Grohne <grohne@cs.uni-bonn.de>**20150113152955
 Ignore-this: e7547acbe5e91c1e4403a336d5410934
] 
[let AUnify TExp handle wildcards
Helmut Grohne <grohne@cs.uni-bonn.de>**20150217143627
 Ignore-this: 190a64a20dab0ac5886e9b152b43d7f4
 
 This fixes a serious bug in igor. The direct call rule development assumed that
 a variable in a lgg returned from AUnify would not be unifiable on the IO
 examples. Consider the following RHS:
 
  ?p (a wildcard)
  S p
  S p
 
 The antiunifier would return a fresh variable, because one TExp contains a
 wildcard. However the unifier could still unify these TExps. Thus the direct
 call could pick any of these RHS (for example the wildcard), generate a call
 (which works) since the chosen RHS matches with all RHS, insert the call even
 though it could violate an IO Example.
 
 The solution is to handle wildcards in the antiunifier as well. As a
 consequence wildcards can now occur in closed rules and thus final hypotheses.
 Another consequence is that a better (less partitions) solution is found for
 the pepper example.
] 
[move isWild to Syntax.Expression and export it
Helmut Grohne <grohne@cs.uni-bonn.de>**20150218123031
 Ignore-this: d9df4366f8267a6d03388e43b32621ab
] 
> hunk ./src/Igor2/RuleDevelopment/Subfunction.hs 52
-abduceIOAt rfs p = rules $ map (fromJust . subrule p . crul) rfs
+abduceIOAt rfs p =
+    let rs         = map crul rfs
+	assertJust Nothing = error ("abduceIOAt called with non-wildcard and non-existent position " ++ show p)
+	assertJust j = j
+        mrs        = [ if isWild (rhs r) then Nothing else assertJust (subrule p r) | r <- rs ]
+        errmsg     = "abduceIOAt with only wildcards and position " ++ show p
+        rhstype    = typeOf . rhs . fromMaybe (error errmsg) . listToMaybe $ catMaybes mrs
+        wildrule r = rule (lhs r) (tWildE "subfunctionwildcard" rhstype)
+    in rules [ fromMaybe (wildrule r) mr | (r, mr) <- zip rs mrs ]
hunk ./src/Igor2/RuleDevelopment/Subfunction.hs 62
-
-
- 