úÎ[ÄW…$      !"# Safe-Inferred$"Concatenate the results after mapM%Function composition deluxe (f .: g) = x y -> f (g x y)& O(n log n) group, but destroys ordering' O(n log n)0 nub by a comparison function. Destroys ordering$%&'$%&'$%&'% None3'Obligations with tagged variables (see  and ).Cheap way of introducing fresh variables. The ( and ) instances only uses the * tag.FGiven a type, return either that you cannot do induction on is type (+), or ,= the constructors and a description of their arguments (see ). The function !should instantiate type variables). For instance, if you look up the type [Nat]9, you should return the cons constructor with arguments Nat and [Nat] (see ).mExamples of types not possible to do induction on are function spaces and type variables. For these, return +./An argument to a constructor can be recursive ( ) or non-recursive (.). Induction hypotheses will be asserted for   arguments.&For instance, when doing induction on [a], then (:) has two arguments, NonRec a and Rec [a]+. On the other hand, if doing induction on [Nat], then (:) has  NonRec Nat and  Rec [Nat].,Data types can also be exponential. Consider -data Ord = Zero | Succ Ord | Lim (Nat -> Ord) Here, the Limy constructor is exponential. If we describe types and constructors with strings, the constructors for this data type is: L[ ("Zero",[]) , ("Succ",[Rec "Ord"]) , ("Lim",[Exp ("Nat -> Ord") ["Nat"]) ]The first argument to Y is the type of the function, and the second argument are the arguments to the function. GQuantifier lists are represented as tuples of variables and their type.Example: ([(x,t1),(y,t2)],[tm1,tm2])corresponds to the formula%forall (x : t1) (y : t2) . P(tm1,tm2) GQuantifier lists are represented as tuples of variables and their type.Example: µObligation { implicit = [(x,t1),(y,t2)] , hypotheses = [([],[htm1,htm2]) ,([(z,t3)],[htm3,htm4]) ] , conclusion = [tm1,tm2] }Corresponds to the formula:Zforall (x : t1) (y : t2) . (P(htm1,htm2) & (forall (z : t3) . P(htm3,htm4)) => P(tm1,tm2))The implicit variables (x and yE) can be viewed as skolemised, and use these three formulae instead: P(htm1,htm2).forall (z : t3) . P(htm3,htm4). ~ P(tm1,tm2). ,Implicitly quantified variables (skolemised)0Hypotheses, with explicitly quantified variablesThe induction conclusionA list of terms. Example:  [tm1,tm2] corresponds to the formula  P(tm1,tm2)MThe simple term language only includes variables, constructors and functions.DInduction on exponential data types yield assumptions with functionsThe * tag-Tri-traverse of ObligationRRemoving tagged (fresh) variables in a monad. The remove function is exectued at every occurence^ of a tagged variable. This is useful if you want to sync it with your own name supply monad.!Removing tagged (fresh) variablesMRemove tagged (fresh) variables in a monad. The remove function is exectued  only once" for each tagged variable, and a .b of renamings is returned. This is useful if you want to sync it with your own name supply monad. /0-    /0-None(Functions for linearising constructors (), variables () and types ().LAn example style where constructors, variables and types are represented as 1.Linearises a list of  , using a given . Linearises an   using a given E. The output format is inspired by TPTP, but with typed quantifiers.! Linearises a  using a given . !2345678  !  !2345678NoneB 9A monad of fresh Integers:Tagged hypotheses; Tagged terms<&Get the representation of the argument=Run the fresh monad>Creating a fresh variable?'Create a fresh variable that has a type@Refresh variableA"Refresh a variable that has a type 9B:;<=>?@A 9B:;<=>?@A 9B:;<=>?@ANone?MCAFind the type of a variable using the index in a type environmentDrInstantiate a variable with a given type, returning the new variables and what the term should be replaced withE%Induction on every variable in a term7Assumption: The variables only occur once in each term.F%Induction several times on a variableG8Unroll to a given depth, but does not add any hypothesesHCMake Obligations: this means to add empty hypotheses to QuantTerms.I;Removes the argument type information from the constructorsJGRemoves the argument type information from the constructors in one Term"nDoes case analysis on a list of typed variables. This function is equal to removing all the hypotheses from #.K;Gets all well-typed subterms of a term, including yourself.&The first argument is always yourself.IWe need terms where the constructors are associated with their arguments.L,Does this term contain a variable somewhere?M!Adds hypotheses to an Obligation.EImportant to drop 1, otherwise we get the conclusion as a hypothesis!EHypotheses that only contain constructors (no variables) are removed.NDAdds hypotheses to an Obligation, requantifying over naked variablesVI.e. forall x y . P(K x,y) becomes forall x y . (forall y'.P(x,y')) -> P (K x,y)EImportant to drop 1, otherwise we get the conclusion as a hypothesis!#`Subterm induction: the induction hypotheses will contain the proper subterms of the conclusion.OPQCRDEFGHIJ"KLMN#"#OPQCRDEFGHIJ"KLMN#None$  !"#$#"    !S      !!"#$%&'()*+,-./01/02345678679:;<=>?6@ABCDEFGHIJKLMNOPQIRSTUVWXYZ[\]^_`abstructural-induction-0.2Induction.StructuralInduction.Structural.AuxiliaryInduction.Structural.TypesInduction.Structural.LineariseInduction.Structural.UtilsInduction.Structural.Subtermspretty-1.1.1.1Text.PrettyPrint.HughesPJrendertextTaggedObligationTagged:~TyEnvArgExpNonRecRec Hypothesis Obligationimplicit hypotheses conclusion PredicateTermFunConVartagunTagMunTag unTagMapMStylelinclinvlintstrStylelinObligations linObligationlinTerm caseAnalysissubtermInduction concatMapM.: groupSortedOn nubSortedOnghc-prim GHC.ClassesEqOrd integer-gmpGHC.Integer.TypeIntegerbase Data.MaybeNothingJust trObligationcontainers-0.5.5.1 Data.Map.BaseMap $fOrdTagged $fEqTaggedGHC.BaseStringcsvparList ampersandbangfluffdarrowdotFreshTaggedHypothesis TaggedTermargReprrunFreshnewFreshnewTyped refreshTaggedrefreshTypedTagged mfindVNoteinst inductionTmrepeatInductionTmnoHypsmakeObligations removeArgs removeArgsubtermshasVar addHypothesesaddHypothesesQ QuantTerms QuantTermCmakeQuantTerms