anchor.diff:  
   type Input = Input of string
   
  -let formatConfig = { FormatConfig.Default with StrictMode = true }
  -
   let tryFormatAST ast sourceCode config =
       try
           formatAST ast sourceCode config
  
positive.code:                 1, Gen.map2 (fun expr typ -> SynExpr.Upcast(expr, typ, zero)) genSubIdentExpr genSubSynType
                  1, Gen.map2 (fun expr typ -> SynExpr.Downcast(expr, typ, zero)) genSubIdentExpr genSubSynType
                  1, Gen.map2 (fun expr typ -> SynExpr.TypeTest(expr, typ, zero)) genSubIdentExpr genSubSynType
                  1, Gen.map2 (fun expr1 expr2 -> SynExpr.DotIndexedGet(expr1, [SynIndexerArg.One expr2], zero, zero)) genSubSynExpr genSubSynExpr
                  1, Gen.map3 (fun expr1 expr2 expr3 -> SynExpr.DotIndexedSet(expr1, [SynIndexerArg.One expr3], expr2, zero, zero, zero)) genSubSynExpr genSubSynExpr genSubSynExpr
                  1, Gen.map2 (fun expr longIdent -> SynExpr.DotGet(expr, zero, longIdent, zero)) genSubSynExpr genSubLongIdentWithDots
                  1, Gen.map3 (fun expr1 expr2 longIdent -> SynExpr.DotSet(expr1, longIdent, expr2, zero)) genSubSynExpr genSubSynExpr genSubLongIdentWithDots
                  1, Gen.map2 (fun expr longIdent -> SynExpr.LongIdentSet(longIdent, expr, zero)) genSubSynExpr genSubLongIdentWithDots
                  1, Gen.map2 (fun b longIdent -> SynExpr.LongIdent(b, longIdent, None, zero)) Arb.generate<_> genSubLongIdentWithDots
                  2, Gen.map3 (fun expr1 expr2 expr3 -> SynExpr.IfThenElse(expr1, expr2, Some expr3, NoSequencePointAtDoBinding, false, zero, zero)) genSubSynExpr genSubSynExpr genSubSynExpr
                  2, Gen.map2 (fun expr1 expr2 -> SynExpr.Sequential(SequencePointsAtSeq, true, expr1, expr2, zero)) genSubSynExpr genSubSynExpr
                  1, Gen.map (fun expr -> SynExpr.Lazy(expr, zero)) genSubSynExpr
                  1, Gen.map2 (fun expr1 expr2 -> SynExpr.TryFinally(expr1, expr2, zero, NoSequencePointAtTry, NoSequencePointAtFinally)) genSubSynExpr genSubSynExpr
                  1, Gen.map2 (fun expr clauses -> SynExpr.TryWith(expr, zero, clauses, zero, zero, NoSequencePointAtTry, NoSequencePointAtWith)) genSubSynExpr genSubSynMatchClauseList
                  1, Gen.map2 (fun expr typs -> SynExpr.TypeApp(expr, zero, typs, typs |> List.map (fun _ -> zero), None, zero, zero)) genSubSynExpr genSubSynTypeList
                  4, Gen.map3 (fun b expr1 expr2 -> SynExpr.App(ExprAtomicFlag.NonAtomic, b, expr1, expr2, zero)) Arb.generate<_> genSubSynExpr genSubSynExpr
                  4, Gen.map2 (fun expr clauses -> SynExpr.Match(NoSequencePointAtDoBinding, expr, clauses, false, zero)) genSubSynExpr genSubSynMatchClauseList
                  2, Gen.map2 (fun b clauses -> SynExpr.MatchLambda(b, zero, clauses, NoSequencePointAtDoBinding, zero)) Arb.generate<_> genSubSynMatchClauseList
                  2, Gen.map3 (fun b pat expr -> SynExpr.Lambda(b, false, pat, expr, zero)) Arb.generate<_> genSubSynSimplePats genSubSynExpr
                  2, Gen.map5 (fun b expr1 expr2 expr3 s -> SynExpr.For(NoSequencePointAtForLoop, Ident(s, zero), expr1, b, expr2, expr3, zero)) Arb.generate<_> genSubSynExpr genSubSynExpr genSubSynExpr genSubIdent
                  2, Gen.map5 (fun b1 b2 expr1 expr2 pat -> SynExpr.ForEach(NoSequencePointAtForLoop, SeqExprOnly b1, b2, pat, expr1, expr2, zero)) Arb.generate<_> Arb.generate<_> genSubSynExpr genSubSynExpr genSubSynPat
                  8, Gen.map3 (fun b bindings expr -> SynExpr.LetOrUse(b, false, bindings, expr, zero)) Arb.generate<_> generateSynBindingList genSubSynExpr
              ]
      
  let generateParsedInput =
  
negative.code: let generateInput = 
      Gen.map (fun ast -> Input (tryFormatAST ast None formatConfig)) generateParsedInput
  
  let fromSynExpr expr =
      let ast =
          let ident = Ident("Tmp", zero)
          ParsedInput.ImplFile
              (ParsedImplFileInput
                 ("/tmp.fs", false,
                  QualifiedNameOfFile ident, [], [],
                  [SynModuleOrNamespace
                     ([ident], true,
                      [SynModuleDecl.DoExpr(NoSequencePointAtDoBinding, expr, zero)], PreXmlDocEmpty, [], None,
                      zero)], false))
      Input (tryFormatAST ast None formatConfig)
  
  let toSynExpr (Input s) =
      match parse false s with
      | ParsedInput.ImplFile
          (ParsedImplFileInput
              ("/tmp.fs", false,
              QualifiedNameOfFile _, [], [],
              [SynModuleOrNamespace
                  (_, true, exprs, _, _, _, _)], false)) -> 
                  List.tryPick(function (SynModuleDecl.DoExpr(_, expr, _)) -> Some expr | _ -> None) exprs
      | ast -> 
          //stdout.WriteLine("Can't convert {0}", sprintf "%A" ast)
          None
  
  let rec shrinkSynExpr = function
      | SynExpr.LongIdentSet(_, expr, _)
      | SynExpr.DotIndexedGet(expr, _, _, _)
      | SynExpr.DotGet(expr, _, _, _)
      | SynExpr.DotSet(expr, _, _, _)
      | SynExpr.TypeTest(expr, _, _)
      | SynExpr.Upcast(expr, _, _)
      | SynExpr.Downcast(expr, _, _)
      | SynExpr.InferredUpcast(expr, _)
      | SynExpr.InferredDowncast(expr, _) 
      | SynExpr.Lazy(expr, _)
      | SynExpr.TypeApp(expr, _, _, _, _, _, _)
      | SynExpr.Do(expr, _)
      | SynExpr.Assert(expr, _)
      | SynExpr.Lambda(_, _, _, expr, _)
      | SynExpr.CompExpr(_, _, expr, _)
      | SynExpr.ArrayOrListOfSeqExpr(_, expr, _)
      | SynExpr.New(_, _, expr, _)
      | SynExpr.Typed(expr, _, _)
      | SynExpr.Paren(expr, _, _, _)
      | SynExpr.AddressOf(_, expr, _, _) -> 
          collectSynExpr expr
      
      | SynExpr.IfThenElse(expr1, expr2, None, _, _, _, _)
      | SynExpr.DotIndexedSet(expr1, _, expr2, _, _, _)
      | SynExpr.NamedIndexedPropertySet(_, expr1, expr2, _)
      | SynExpr.Sequential(_, _, expr1, expr2, _)
      | SynExpr.TryFinally(expr1, expr2, _, _, _)
      | SynExpr.App(_, _, expr1, expr2, _)
      | SynExpr.ForEach(_, _, _, _, expr1, expr2, _)
      | SynExpr.While(_, expr1, expr2, _)
      | SynExpr.Quote(expr1, _, expr2, _, _) -> 
          seq { yield! collectSynExpr expr1; yield! collectSynExpr expr2 }
      | SynExpr.Const(_, _) -> Seq.empty
      | SynExpr.ArrayOrList(_, exprs, _)
      | SynExpr.Tuple(exprs, _, _) ->
          seq { yield! Seq.collect collectSynExpr exprs }
      | SynExpr.Record(_, _, _, _) -> Seq.empty
      | SynExpr.ObjExpr(_, _, _, _, _, _) -> Seq.empty
  
      | SynExpr.IfThenElse(expr1, expr2, Some expr3, _, _, _, _)
      | SynExpr.DotNamedIndexedPropertySet(expr1, _, expr2, expr3, _)
      | SynExpr.For(_, _, expr1, _, expr2, expr3, _) -> 
          seq { yield! collectSynExpr expr1; yield! collectSynExpr expr2; yield! collectSynExpr expr3 }
      | SynExpr.MatchLambda(_, _, clauses, _, _) -> 
          seq { yield! Seq.collect collectSynMatchClause clauses }
      | SynExpr.TryWith(expr, _, clauses, _, _, _, _)
      | SynExpr.Match(_, expr, clauses, _, _) -> 
          seq { yield! collectSynExpr expr; yield! Seq.collect collectSynMatchClause clauses }
      | SynExpr.LetOrUse(_, _, bindings, expr, _) -> 
          seq { yield! Seq.collect collectSynBinding bindings; yield! collectSynExpr expr }
      | SynExpr.Ident(_) -> Seq.empty
      | SynExpr.LongIdent(_, _, _, _) -> Seq.empty
      | SynExpr.Null(_) -> Seq.empty
      | SynExpr.TraitCall(_, _, _, _) -> Seq.empty
      | SynExpr.JoinIn(_, _, _, _) -> Seq.empty
      | SynExpr.ImplicitZero(_) -> Seq.empty
      | SynExpr.YieldOrReturn(_, _, _) -> Seq.empty
      | SynExpr.YieldOrReturnFrom(_, _, _) -> Seq.empty
      | SynExpr.LetOrUseBang(_, _, _, _, _, _, _) -> Seq.empty
      | SynExpr.DoBang(_, _) -> Seq.empty
      | SynExpr.LibraryOnlyILAssembly(_, _, _, _, _) -> Seq.empty
      | SynExpr.LibraryOnlyStaticOptimization(_, _, _, _) -> Seq.empty
      | SynExpr.LibraryOnlyUnionCaseFieldGet(_, _, _, _) -> Seq.empty
      | SynExpr.LibraryOnlyUnionCaseFieldSet(_, _, _, _, _) -> Seq.empty
      | SynExpr.ArbitraryAfterError(_, _) -> Seq.empty
      | SynExpr.FromParseError(_, _) -> Seq.empty
      | SynExpr.DiscardAfterMissingQualificationAfterDot(_, _) -> Seq.empty
  
  and collectSynExpr expr =
      seq { yield expr 
            yield! shrinkSynExpr expr }
  
  and collectSynMatchClause (SynMatchClause.Clause(_, exprOpt, expr, _, _)) =
      seq { yield! exprOpt |> Option.map collectSynExpr |> fun arg -> defaultArg arg Seq.empty
            yield! collectSynExpr expr }
  
  and collectSynBinding (SynBinding.Binding(_, _, _, _, _, _, _, _, _, expr, _, _)) =
      collectSynExpr expr
  
  let shrinkInput input = 
      match toSynExpr input with
      | None -> 
          stdout.WriteLine("Can't shrink {0}", sprintf "%A" input)
          Seq.empty
      | Some expr -> 
          shrinkSynExpr expr |> Seq.map fromSynExpr
  
  type Generators = 
      static member range() =
          Arb.fromGen generateRange
      static member Input() = 
          Arb.fromGenShrink (generateInput, shrinkInput)
          // Temporarily filter out bad generated inputs
          |> Arb.filter (fun input -> (toSynExpr input).IsSome)
  
  [<TestFixtureSetUp>]
  let registerFsCheckGenerators() =
  