qI;      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./012 3 4 5!6!7!8!9!:!&"Safe ;<=>?@ABCDEFG<BCDEFG ;<=>?@ABCDEFGSafe:OT lAdds a metric at the beginning of the list (note we reverse the order whene we want to print the metrics)HI JK    HI JKSafe9;An alternative L4 instance (the idea being that we should reserve L for outputting actual Haskell)Minimal implementation is  or  between l r t == l <> t <> rparens t puts t between parentheses (()) squares t puts t between square brackets ([])XSeparated by space unless one of them is empty (in which case just the non-empty one)eI think I want ($+$) here but I'm not sure I understand the documentation from the pretty package.t1  t2^ separates the two by a newline, unless one of them is empty. The vertical equivalent to '( +)'vPuts list items on the same line if they are smaller than a certain width otherwise, puts a newline in between them prettyCount toBlah "" (x,1) == "blah" prettyCount toBlah "foos" (x,1) == "blah" prettyCount toBlah "" (x,4) == "blah 4" prettyCount toBlah "foos" (x,4) == "blah 4 foos"   None0  7 is something you want to perform detect polarities on."RestrictedPolarityKey c attU is a polarity key in which we only pay attention to nodes that have the category cR. This makes it possible to have polarities for a just a small subset of nodes* attribute !"#$%&'()*+,-./0 !"#$%&'()*+,'()*0& !"#$%+,/.- !"#$%&'()*+,-./0Safe9:;6$GenI format; should round-trip with # by rights"Minimal definition, either one of 7 or 86789:;6789:678;9:6789:;None09IM,Intermediary type used for alphanumeric sort?putStr on stderrD;Drop all characters up to and including the one in questionE/Make the first character of a string upper caseF/Make the first character of a string lower caseHIL but only if it contains characters that are not used in GenI identifiersJbreak a list of items into sublists of length < the clump size, taking into consideration that each item in the clump will have a single gap of padding interspersedUany item whose length is greater than the clump size is put into a clump by itselfgiven a length function <clumpBy (length.show) 8 ["hello", "this", "is", "a", "list"]K:An alphanumeric sort is one where you treat the numbers in the string as actual numbers. An alphanumeric sort would put x2 before x100, because 2 < 10, wheraeas a naive sort would put it the other way around because the characters 1 < 2. To sort alphanumerically, just 'sortBy (comparing toAlphaNum)'RA strict version of NS/True if the intersection of two lists is empty.TServes the same function as O. It groups together items by some property they have in common. The difference is that the property is used as a key to a Map that you can lookup.Z8Return the list, modifying only the first matching item.[Strict version of mapTree (for non-strict, just use fmap)\Like Pn, except on Trees. Filter might not be a good name, though, because we return a list of nodes, not a tree.]The leaf nodes of a Tree^"Return pairs of (parent, terminal)__  fn filt t returns a version of t" in which the first node which filt matches is transformed using fn.`Like _p except that it performs the operations on all nodes that match and doesn't care if any nodes match or notaLike _ but on a list of tree nodesbReplace a node in the tree in-place with another node; keep the children the same. If the node is not found in the tree, or if there are multiple instances of the node, this is treated as an error.cIgnore error stringdGerrors specifically in GenI, which is very likely NOT the user's fault.f*The module name for an arbitrary data typegAdd two intervalshh x builds a trivial interval from x to xj5displays a bit vector, using a minimum number of bits3<=>MQR?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_replacement functionfiltering function`areplacement functionfiltering functionnodesb which node?cdefghijk/<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij/?@ABDCEFKGIHJLMNOPQRWSTUVXYZ[\]^_`ab>ghi<=jcdef0<=>MQR?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkSafe9qqqqNone r7Note: you can define the final state either by setting u to Just f where f+ is some function or by putting them in vuy will use this if definedvcan be ignored if u is definedwjthere can be more than one transition between any two states and a transition could be the empty symbolxdif you don't care about grouping states into columns you can just dump everything in one big listyy- returns all the final states of an automatonzz  aut st1 ab returns the states that st1 transitions to via a.|XReturns all possible paths through an automaton from the start state to any dead-end.-Each path is represented as a list of labels.>We assume that the automaton does not have any loops in it.})The set of all bundled paths. A bundled path is a sequence of states through the automaton from the start state to any dead end. Any two neighbouring states can have more than one possible transition between them, so the bundles can multiply out to a lot of different possible paths.'The output is a list of lists of lists:Each item in the outer list is a bundled path through the automaton, i.e. without distinguishing between the possible transitions from any two neighbouring statesjEach item in the middle list is represents the set of transitions between two given neighbouring statesOEach item in the inner list represents a transition between two given statesrstuvwxyz{ from state transitionto state|}~rsxwtuvyz{|}~rstuvwxy{z|}~rstuvwxyz{|}~ Safe0  5$Safe None$09:;*)A structure that can be traversed with a I-replacing function (typical use case: substitution after unification)iApproach suggested by Neil Mitchell after I found that Uniplate seemed to hurt GenI performance a bit.descendGeniVal f x applies f to all  in xA schema value is a disjunction of GenI values. It allows us to express fancy  disjunctions in tree schemata, ie. disjunctions over variables and not just atoms (?X;?Y).tOur rule is that that when a tree schema is instantiated, any fancy disjunctions must be crushed  into a single  lest it be rejected (see )Note that this is still not recursive; we don't have disjunction over schema values, nor can schema values refer to schema values. It just allows us to express the idea that in tree schemata, you can have either variable ?X or ?Y.An Idable is something that can be mapped to a unique id. You might consider using this to implement Ord, but I won't. Note that the only use I have for this so far (20 dec 2005) is in alpha-conversion.A  is something which can return its variables as a map from the variable to the number of times that variable occurs in it.Important invariant: if the variable does not occur, then it does not appear in the map (ie. all counts must be >= 1 or the item does not occur at all)WBy variables, what I most had in mind was the GVar values in a GeniVal. This notion is probably not very useful outside the context of alpha-conversion task, but it seems general enough that I'll keep it around for a good bit, until either some use for it creeps up, or I find a more general notion that I can transform this into. collect x m+ increments our count for any variables in x+ (adds not-yet-seen variables as needed)$A variable label and its constraintsUnification can either &$succeed for free (no substitutions),$succeed with a one-way substitution,Fsucceed w both vars needing substitution (constraint intersection),or failMA variable substitution map. GenI unification works by rewriting variables%constant : no label, just constraints-variable : label, with or without constraints$anonymous : no label, no constraintsOptional label (?X would have Just X)?Optional values/constraints Must have at least one if at all\Though it may seem a bit redudant, this is not quite the same as having '[Text]' because Nothing" means no constraints; whereas Just []% (impossible here) would mean bottom. x :! [] creates a single constant.  x :! xsa creates an atomic disjunction. It makes no difference which of the values you supply for x and xs) as they will be sorted and nubed anyway.1Create a singleton constant (no disjunction here)Create a variable%Create a variable with no constraintsCreate an anonymous valueIf v- has exactly one value/constraint, returns it An anonymous  (_ or ?_) has no labels/constraints For debugging& performs unification on two lists of *. If unification succeeds, it returns  Just (r,s) where rl is the result of unification and verb!s! is a list of substitutions that this unification results in.l1  l2 returns the result of l1  l2E if doing a simultaneous traversal of both lists, each item in l1$ subsumes the corresponding item in l2unifyHelper unf gs1 gs2/ zips two lists with some unification function.#It's meant to serve as a helper to  and bNote that the first Subst is assumed to come chronologically before the second one; so merging  { X -> Y } and  { Y -> 3 } should give us { X -> 3; Y -> 3 };See  for a warning!!Add to variable replacement to a Q that logical comes before the other stuff in it. So for example, if we have Y -> foo and we want to insert X -> Y, we notice that, in fact, Y! has already been replaced by foo , so we add X -> foo insteadANote that it is undefined if you try to append something like Y -> foo to Y -> bar7, because that would mean that unification is brokenSee source code for details[Note that we assume that it's acceptable to generate new variable names by appending an x] to them; this assumption is only safe if the variables have gone through the function i or have been pre-processed and rewritten with some kind of common suffix to avoid an accidental match*intersectConstraints (Just cs1) (Just cs2) returns the intersection of cs1 and cs2 if non-empty (or S if there's nothing in common)*If any of the arguments is unconstrained (Nothing!), we simply return the other. x y returns the same result as  unifyOne x y if x subsumes y or  otherwiseApply variable substitutions$Apply a single variable substitutiontHere it is safe to say (X -> Y; Y -> Z) because this would be crushed down into a final value of (X -> Z; Y -> Z)Core implementation for  For use by the Uniplate-esq Core implementation for  For use by the Uniplate-esq :Anonymise any variable that occurs only once in the object appends a unique suffix to all variables in an object. This avoids us having to alpha convert all the time and relies on the assumption finding that a unique suffix is possible. does the following:_(if suffix is non-null) appends a suffix to all variable names to ensure global uniquenessHintersects constraints for for all variables within the same objectZConvert a fancy disjunction (allowing disjunction over variables) value into a plain old atomic disjunction. The idea is to support a limited notion of fancy disjunction by requiring that there be a single point where this disjunction can be converted into a plain old variable. Note that we currently convert these to constants only.$Convert a list of fancy disjunctions=non-empty listlabel constraints.=2%None09;#% None09:;<= XExperimental, alternative representation of Flist which guarantees uniqueness of keys2An attribute-value pair, the typical use being AvPair GeniVal* or if you have something even simpler  AvPair TextA list of attribute-value pairs. It's not a great idea to represent feature structures with this because it allows for duplicates in the attributes. But maybe sometimes you really do mean a list.!A feature structure with no pairs Convert an  to a proper ( Unsafely assumes the keys are unique Convert an  to a simpler to process +Sort an Flist according with its attributesX performs feature structure unification, under the these assumptions about the input:Features are orderedHThe Flists do not share variables (renaming has already been done.QThe features are allowed to have different sets of attributes, beacuse we use  to realign them. is a pre-procesing step used to ensure that feature structures have the same set of keys. If a key is missing in one, we copy it to the other with an anonymous value.:The two feature structures must be sorted for this to work Helper for ; ignore0Flatten a fancy disjunction attribute-value pairSee  for details-Flatten a fancy-disjunction feature structureSee  for details None09;AT7Flags are GenI's internal representation of command line arguments. We use phantom existential types (?) for representing GenI flags. This makes it simpler to do things such as ``get the value of the MacrosFlg'' whilst preserving type safety (we always know that MacrosFlg is associated with String). The alternative would be writing getters and setters for each flag, and that gets really boring after a while.9gWhat kind of elementary trees we're getting. The typical use case is to provide tree schemata with : (which then get anchored into the lexicon to give us elmentary trees). You can also have precompiled trees hardcoded into your GenI-like program, or read preanchored elementary trees from somewhere else.:geni's text format;"built into geni, no parsing needed<lexical selection already done=*The tree assembly algorithm we want to use@?A test suite and any test cases within that we want to pick outARequested optimisationsAt the time of this writing (2012-08-21), this is fairly sparse as a lot of proposed optimisations have just been absorbed into GenI as mandatory things.B$all polarity-related optimisationsC$all adjunction-related optimisationsDpolarity filteringE+ignore literal constraints (pessimisation?)F-guided realisation (needs polarity filtering)M*This only has an effect if the flag is setRupdateFlags new old takes the flags from new plus any from old that aren't mentioned in itd      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMflag constructorNOPQRnewoldSTUa      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRdABCDEF@=>?9:;<GHUI78456TSJKLMNOPQR2301./,-*+()&'$%"# !     6      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU NoneDPath equations can either hit a feature or a node's lexeme attribute!Left hand side of a path equationYParse a path equation using the GenI conventions This always succeeds, but can return  Just warningA if anything anomalous comes up FIXME : make more efficient|}~|}~|}~|}~None09:;<=YAnything that we would want to count the number constants in (as opposed to variables)Number of constants1Semantics, index constraints, literal constraintsThe intention here is that for (sem, icons, lcons) all (T sem) lconsAA literal and any constraints associated with it (semantic input)&A semantics is just a set of literals.IA single semantic literal containing its handle, predicate, and argumentsMThis can be paramaterised on the kinds of variables it uses, for example, F for a semantics that you might still want to do unification on or U if it's supposed to be ground.Gthe handle can be seen as a special kind of argument; stored separately:An empty literal, not sure you should really be using thisGStrip any index or literal constraints from an input. Use with care.Default sorting for a semantics Default comparison for a literalSort primarily putting the ones with the most constants first and secondarily by the number of instances a predicate occurs (if plain string; atomic disjunction/vars treated as infinite)9Helper for displaying or pretty printing a semantic inputEThis gives you a bit of control over how each literal is displayedIs a handle generated by GenI. GenI lets you write literals without a handle; in these cases a unique handle is generated and hidden from the UI.x  y+ returns all the possible ways to unify x with some SUBSET of y so that x subsumes y. If x does NOT subsume y, we return the empty list. Helper for  traversalp1  p2 is the unification of p1 and p2[ if both literals have the same arity, and the handles, predicates, and arguments in p1# all subsume their counterparts in p2Return the list of minimal ways to unify two semantics, ie. where any literals that are not the product of a succesful unification really do not unify with anything else.Helper traversal for jTwo literals unify if they have the same arity, and their handles, predicates, and arguments also unify&&!None0ATA sentence composed of  instead of plain old words'A lemma plus its morphological features   None09;<=An annotated GeniVal. This is for a rather old, obscure variant on the polarity filtering optimisation. To account for zero literal semantics, we annotate each value in the semantics with a positive/negative marker. These markers are then counted up to determine with we need to insert more literals into the semantics or not. See the manual on polarity filtering for more details Lexical entry9normally just a singleton, useful for merging synonymstree family to anchor to+parameters (deprecrated; use the interface),features to unify with tree schema interface+features to pick out family members we wantpath equationslexical semantics#polarities (must be same length as )Collection of lexical entries See also 3 This version comes with some sensible defaults. Variant of  but with more controlSeparate an input lexical semantics into the actual semantics and the semantic polarity entries (which aren't used very much in practice, being a sort of experimental feature to solve an obscure-ish technical problem)VNote that by convention we ignore the polarity associated with the predicate itselfword family nameparameters list (deprecated)!interface (use instead of params)filters equations semanticsword family nameparameters list (deprecated)!interface (use instead of params)filters equations semanticssemantic polarities &NoneNone09;A single node of a TAG tree.top feature structurebottom feature structureFalse for na nodes[] for na nodesQfor TAG, this would be the elementary tree that this node originally came from;Essentially boolean representation of adjunction constraint%hard-coded null-adjunction constraintBinferred by GenI to be adjunction free (ie. during realisation)Given a lexical item s^ and a Tree GNode t, returns the tree t' where l has been assigned to the anchor node in t'Given a lexical item l and a tree node n (actually a subtree with no children), return the same node with the lexical item as its unique child. The idea is that it converts terminal lexeme nodes into preterminal nodes where the actual terminal is the given lexical itemUAdd an inferred adjunction constraint marker unless we already see an explicit one5Return the value of the "cat" attribute, if available8Attributes recognised as lexemes, in order of preference#A single node of a TAG tree.-The default show for GNode tries to be very compact; it only shows the value for cat attribute and any flags which are marked on that node.pThis is one the places where the pretty representation of a GenI object is different from its GenI-format oneD      !"#$%&'()*+,-./01234561      !"1     ! ")       !"#$%&'()*+,-./0123456None09;<= CC is a generalisation of M.X can be empty_dAn anchored grammar. The grammar associates a set of semantic predicates to a list of trees each.`addTags  tags key elem adds elem5 to the the list of elements associated to the keyaGiven a tree(GNode) returns a list of substitution or adjunction nodes, as well as remaining nodes with a null adjunction constraint.fPlug the first tree into the second tree at the specified node. Anything below the second node is silently discarded. We assume the trees are pluggable; it is treated as a bug if they are not!gGiven two trees auxt and t, splice the tree auxt into t via the TAG adjunction rule.hlAssigns a unique id to each element of this list, that is, an integer between 1 and the size of the list.i2Sorts trees into a Map.Map organised by the first literal of their semantics. This is useful in at least three places: the polarity optimisation, the gui display code, and code for measuring the efficiency of GenI. Note: trees with a null semantics are filed under an empty predicate, if any.jFNormally, extracting the sentences from a TAG tree would just consist of reading its leaves. But if you want the generator to return inflected forms instead of just lemmas, you also need to return the relevant features for each leaf. In TAG, or at least our use of it, the features come from the *pre-terminal* nodes, that is, not the leaves themselves but their parents. Another bit of trickiness: because of atomic disjunction, leaves might have more than one value, so we can't just return a String lemma but a list of String, one for each possibility.k2Try in order: lexeme, lexeme attributes, node name?VCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abWcdefgfoot node of the aux treeaux treeplace to adjoin in target tree target treeXYhZijk[lmnopqrstuvwxyz{.CDEFGHIJKLMNOTSQRPUVWXYZ[\]^_`abcdefghijklmno._MNOPQRSTUVWXCDEFGYZ[\]^LHIJKcdelomn`jkbhfgia(VCDEFGHIJKLM NOPQRSTUVWXYZ[\]^_`abWcdefgXYhZijk[lmnopqrstuvwxyz{NoneGiven a description of what the root feature should unify with return a -1 polarity for all relevant polarity keys. This allows us to compensate for the root node of any derived tree.*Convert any unconstrained polarities in a J to constrained ones, assuming a global list of known constrained keys.Ensures that all states and transitions in the polarity automaton are unique. This is a slight optimisation so that we don't have to repeatedly check the automaton for state uniqueness during its construction, but it is essential that this check be done after construction:Note that this will crash if any of the entries are errors:Note that this will crash if any of the entries are errorspolarity to assignattribute to look for feature structure to filter on (" only)#feature structure to get value fromon error messageNone Fposition in the input semantics, extra semantics, polarity interval@intermediate auts, seed aut, final aut, potentially modified semConstructs a polarity automaton. For debugging purposes, it returns all the intermediate automata produced by the construction algorithm.\'Note: this is not the same function as '(! The fact that we preserve the order of the input semantics is important for our handling of multi-literal semantics and for semantic frequency sorting.]<The pruning algorithm takes as arguments a list of states to process. Among these, any state which does not have outgoing transitions is placed on the blacklist. We remove all transitions to the blacklist and all states that only transition to the blacklist, and then we repeat pruning, with a next batch of states.Finally, we return the pruned automaton. Note: in order for this to work, it is essential that the final states are *not* included in the list of states to process.iReturns a modified input semantics and lexical selection in which pronouns are properly accounted for.^fBuilds a fake semantic predicate that the index counting mechanism uses to represent extra columns.__ is a useful way to restrict the behaviour of null semantic items like pronouns using the information generated by the index counting mechanism. The problem with null semantic items is that their indices are not set, which means that they could potentially combine with any other tree. To make things more efficient, we can set the index of these items and thus reduce the number of spurious combinations.NotesThese combinations could produce false results if the input has to use multiple pronouns. For example, if you wanted to say something like John promises Mary to convince Paul to give her his book , these combinations could instead produce give him her* book .This function works by FS unification on the root node of the tree with the *[idx:i]*. If unification is not possible, we simply return the tree as is.AThis function renames the tree by appending the index to its nameGiven a list of paths (i.e. a list of list of trees) return a list of trees such that each tree is annotated with the paths it belongs to.7Render the list of polarity automaton paths as a string]A (trivially) packed representation of the singleton set containing a single polarity path`&an initial state for polarity automata3abcde polarities to detect (eg. "cat")root features to compensate forexplicit extra polaritiesinput semanticslexical selection\fghijk]l^m_nop`. !"#$%&'()*+,rxwy|!|yrwx-abcde\fghijk]l^m_nop`None0<=Dispatching consists of assigning a chart item to the right part of the chart (agenda, trash, results list, etc). This is implemented as a series of filters which can either fail or succeed. If a filter fails, it may modify the item before passing it on to future filters.iA SentenceAut represents a set of sentences in the form of an automaton. The labels of the automaton are the words of the sentence. But note! word  in the sentence is in fact a tuple (lemma, inflectional feature structures). Normally, the states are defined as integers, with the only requirement being that each one, naturally enough, is unique.2 represents the set of inputs a backend could takefor the debuggertag tree?initialise the machine from the semantics and lexical selectionrun a realisation step+run all realisations steps until completion$determine if realisation is finished-unpack chart results into a list of sentencesEquivalent to qA unless the input contains an empty or uninstatiated semanticsMPerforms surface realisation from an input semantics and a lexical selection.Statistics tracked hpol_used_bundles - number of bundled paths through the polarity automaton. see }<pol_used_paths - number of paths through the final automatonpol_seed_paths - number of paths through the seed automaton (i.e. with no polarities). This is normally just 1, unless you have multi-literal semanticsMpol_total_states - combined number of states in the all the polarity automataHpol_total_tras - combined number of transitions in all polarity automataPpol_max_states - number of states in the polarity automaton with the most statesYpol_total_tras - number of transitions in the polarity automata with the most transitions;sem_literals - number of literals in the input semantics:lex_trees - total number of lexically selected treesassign a bit vector value to each literal in the semantics the resulting map can then be used to construct a bit vector representation of the semanticsDefault implementation for the  function in Sequence two dispatch filters.XIf the item meets some condition, use the first filter, otherwise use the second one.@The names of lexically selected chart items used in a derivation3rst-L-L"rstNone uempty for globalvSame as  with the sorting invertedthe trace must appearthe trace must NOT appear-these traces must not appear AT THE SAME TIMEw=A positive constraint is violated when a trace is NOT presentx9A negative constraint is violated when a trace is presentNote that we will not notice if a constraint is violated more than once. If you want to count multiple violations, you'll either need to partition the input strings and map this function on each sublist or rewrite this code.yXViolations sorted so that the highest ranking constraint (smallest number) goes firstzSort the sentences so that the ones with the *lowest* ranking violations (biggest number) go first. Note that we return in groups for the sake of ties.{/Results are grouped so that ties can be noticed|Whitespace-sensitive wrapping Properties:Only splits at whitespaceLines at most len' characters long, whitespace permitting4}~uvwxlex nametracesyz{| wrap after these many characters wrap after these many characters)}~uvwxyz{|None -Inputs that go around a single testcase/inputICustom morph realiser may define a custom set of flags that it accepts/OT constraints (optional, uses global if unset)WNote that this affects the geniFlags; we assume the morph flags are not our business  newold      Nonefor guiexpected results (for testing)  None9; @Should be purely internal type to help parsing. Injection to .We don't just use GType directly because the annotations convey subtle distinctions that aren't encoded, particularly between lexemes and anchors=The original string representation of the semantics (for gui)#EJust the String representations of the semantics in the test suite$-This is only used by the script genimakesuiteHThe original string representation of a test case semantics (for gui))]This makes it possible to read anchored trees, which may be useful for debugging purposes.FIXME: note that this is very rudimentary; we do not set id numbers, parse polarities. You'll have to call some of our helper functions if you want that functionality. recognises a list of parameters optionally followed by a bang (verb$!$) and a list of attribute-value pairs. This whole thing is to wrapped in the parens.TODO: deprecate? associates a numerical value to a polarity symbol, that is,  or .Like ", but also accepts string literalsLike " but allows for reserved words too>Accepts: identifiers, bare reserved words, and string literals)identifier, permitting reserved words tooJ !"#$%&'()*+,-.      !"#$%&'()*+,-./0123456789:;<= !"#$%&'()*+,"!#$()'* %&+,D !"#$%&'()*+,-.None$AT 0$The default parameters configuration3wUses the GetOpt library to process the command line arguments. Note that we divide them into basic and advanced usage.:GPrint out a GenI-style usage message with options divided into sections>gDisplays the usage text for optimisations. It shows a table of optimisation codes and their meaning.?xIf we do not recognise a code, we output an error message. We also take the liberty of expanding thematic codes like pol- into the respective list of optimisations.@SReturns |Left| for any codes we don't recognise, or |Right| if everything is ok.E,TODO: This is a horrible and abusive use of AB<Hint: compose with (map toLower) to make it case-insensitiveC*Is case-insensitive, error if unknown typeJpUpdate the internal instructions list, test suite and case according to the contents of an instructions file.Basic approach~we always have instructions: if no instructions file, is specified we infer virtual instructions from the test suite flagfthe testsuite and testcase flags are focusing tools, they pick out a subset from the instructionsXDEFGHIJKLMNOP01Q2R345S678flag:string reader for flag (probably |id| if already a String) description9flag default valuestring reader (as in reqArg) description:options prog nameT;<=>?U@AVWXYZ[\B]C^_`Dabcdefgh>?@iEFGBCjklmHInJoKpLqrstuvMNOwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR  0123456789:;<=>?@ABCDEFGHIJKL12G0=;<:45J3>DI?FHBC@A6789EKLODEFGHIJKLMNOP01Q2R345S6789:T;<=>?U@AVWXYZ[\B]C^_`Dabcdefgh>?@iEFGBCjklmHInJoKpLqrstuvMNONone0SZConverts information from a morphological information file into GenI's internal format.TFilters away from an input semantics any literals whose realisation is strictly morphological. The first argument tells us helps identify the morphological literals -- it associates literals with morphological stuff; if it returns S, then it is non-morphologicalUU morphfn sem candsA does the bulk of the morphological input processing. We use morphfn# to determine which literals in sem contain morphological information and what information they contain. Then we attach this morphological information to the relevant trees in cand. A tree is considered relevant w.r.t to a morphological literal if its semantics contains at least one literal whose first index is the same as the first index of the morphological literal.>Actually unify the morphological features into the anchor node\FIXME: we'll need to make sure this still works as promised when we implement co-anchors.VsetMorphAnchor n t) replaces the anchor node of a tree with nWe assume the tree has exactly one anchor node. If it has none, this explodes; if it has more than one, they all get replaced.WExtracts the lemmas from a list of uninflected sentences. This is used when the morphological generator is unavailable, doesn't work, etc.XGConverts a list of uninflected sentences into inflected ones by callingSTUVWXYZSTUVWXSTUVXW STUVWXYZNone09;<=NT[6Things whose only use is within the graphical debugger]Cnodes to highlight if there are things wrong with this item, what?hactually a set-guided realisation: polarity paths to explorelast-in-first-outguided realisation5True if the chart item has no open substitution nodes+True if the chart item is an auxiliary tree True if both  and  are True Creates an initial SimpleStatus.$Initial paths for guided realisation"Mark these nodes as non-adjunctionMArbitrarily selects and removes an element from the agenda and returns it.+Last-in-first-out selection from the agenda'Guided realisation variant on selectionNote: returns ONE possible substitution (the head node) of the first in the second. As all substitutions nodes should be substituted we force substitution in order.Ignore the next adjunction nodeIgnore the next adjunction nodeIgnore the next adjunction node[Trash an item, marking it as failing due to top/bot unification error (and on what node)Given a tree, identify nodes that cannot take adjunction and do top-bottom unification on them. Hopefully this will allow us to detect top-bottom unification failures early on.Note: no need to propagate substitutions outside of this because items are assumed to be self-contained. This sort of thing (what is self-contained) should really be reflected in the types.Retrieves a list of trees from the chart which could be combined with the given agenda tree. The current implementation searches for trees which * do not have overlapping semantics with the given * are on the some of the same polarity automaton paths as the current agenda item2Helper function for when chart operations succeed.!Mark this nodes as non-adjunction-This is only used for the one-phase algorithmxIf the item (ostensibly a result) does not have the correct root category, return Nothing; otherwise return Just item[\]^_`abcdefghijklmnopqrstuvwxyz{|}~use two phase algorithm input items GenI options disable gui failure msg aux treesmenodes to highlight node namenew top feature*[\^]_`abcdefghijklmnousvtrqpwxyz{|}~1zyxopqrstuvwabcdefghijklmn|{}pqrt~v[\]^_`suf[\]^_`a bcdefghijklmno pqrstuvwxyz{|}~NoneAA warning that should be repeated for each lexical entry affectedA single custom warning4Literals which did not receive any lexical selection(Warnings from the morphological realiser This exists because we want the g instance, providing a GenI-specific notion of appending which merges instances of the same error,Sort, treating non-comporable items as equal-A warning may be displayed over several lines)NoneNoneL#The O monad supports warnings during lexical selection and also failure via Maybe+The result of the lexical selection process?the main result: a set of elementary trees (ie. anchored trees)tif available, lexical entries that were used to produce anchored trees (useful for identifying anchoring failure) HINT: use *+ to initialise to emptySee ,E if you want to use GenI with a custom lexical selection function.{This aims to support users who want to do lexical selection directly from an input other than GenI style flat semantics.oThe requirement here is for you to provide some means of converting the custom semantics to a GenI semantics7Conversion from custom semantics to GenI semantic inputLexical selection functionLList of named inputs intended to act as a substitute for test suites (/ argument is for reporting error messages only)<Performs standard GenI lexical selection as described in >http://projects.haskell.org/GenI/manual/lexical-selection.html This is just  lifted into IO Helper for 6 (Standard GenI lexical selection is actually pure) This is justmissingLexEntries ts lexs* returns any of the lexical candidates lexs/ that were apparently not anchored succesfully.iTODO: it does this by (wrongly) checking for each lexical item to see if any of the anchored trees in ts have identical semantics to that lexical item. The better way to do this would be to throw a subsumption check on top of items reported missing, because it's possible for the trees to add semantics through unification.gSelect and returns the set of entries from the lexicon whose semantics subsumes the input semantics. sem l$ attempts to unify the semantics of l with semM If this succeeds, we use return the result(s); if it fails, we reject l" as a lexical selection candidate. is a factorisation technique that uses atomic disjunction to merge all synonyms into a single lexical entry. Two lexical entries are considered synonyms if their semantics match and they point to the same tree families.FIXME: 2006-10-11 - note that this is no longer being used, because it breaks the case where two lexical entries differ only by their use of path equations. Perhaps it's worthwhile just to add a check that the path equations match exactly.Note an anchoring error!defaultAnchoring schemata lex semg implements the later half of lexical selection (tree anchoring and enrichement). It assumes that lext consists just of the lexical items that have been selected, and tries to combine them with the tree schemata.This function may be useful if you are implementing your own lexical selection functions, and you want GenI to take over after you've given it a  [LexEntry]dGiven a lexical item, looks up the tree families for that item, and anchor the item to the trees.Combine a single tree with its lexical item to form a bonafide TagElem. This process can fail, however, because of filtering or enrichementSee  9http://kowey.github.io/GenI/manual/lexical-selection.html on enrichement Helper for ! (enrich by single path equation) Helper for enrichFeat av fs attempts to unify av with fsNote here that fs is an Flist [GeniVal] rather than the usual  Flist GeniVal3 you may expect. This is because it comes from ) which allows non-atomic disjunctions of GeniValg which have to be flatten down to at most atomic disjunctions once lexical selection is complete.missingCoanchors l t. returns the list of coanchor node names from l that were not found in tcSplit a lex entry's path equations into interface enrichement equations or (co-)anchor modifiersseekCoanchor lhs t returns  Just node if t8 contains exactly one node that can be identified by lhs, Nothing if it contains none.hIt crashes if there is more than one such node, because this should have been caught earlier by GenI.matchNodeName lhs n is True if the lhs refers to the node nmatchNodeNameHelperF recognises anchor  by convention; otherwise, it does a name match+The lemanchor mechanism is described in 4http://projects.haskell.org/manual/lexical-selection?The name of the lemanchor attribute (by convention; see source) setOrigin n t marks the nodes in t% as having come from a tree named nStandard post-processing/filtering steps that can take place after lexical selection. Right now, this only consists of paraphrase selectionARule out lexical selection results that violate trace constraints4 if the tree fulfills the supplied trace constraints,any warnings, plus the results,,None09;AT) original  uninflected resultresults after morphology1warnings local  to this particular item, cf. !derivation tree behind the resultnormally a chart item id7the lexical selection behind this result (info only)see -"which OT constraints were violatedm is the outcome of running GenI on a single input semantics. Each distinct result is returned as a single d (NB: a single result may expand into multiple strings through morphological post-processing),one per chart itemusually from lexical selection=things like number of chart items to help study efficiencyThe file loading functions all work the same way: we load the file, and try to parse it. If this doesn't work, we just fail in IO, and GenI dies. If we succeed, we update the program state passed in as an IORef.-The program state consists of its configuration options and abstract, cleaned up representations of all the data it's had to load into memory (tree schemata files, lexicon files, etc). The intention is for the state to stay static until the next time something triggers some file loading.the current configuration tree schematalexical entriesdfunction to extract morphological information from the semantics (you may instead be looking for .)simplified traces (optional)=The program state when you start GenI for the very first time'We have one master function that loads all the files GenI is expected to use. This just calls the sub-loaders below, some of which are exported for use by the graphical interface. The master function also makes sure to complain intelligently if some of the required files are missing.ANote that here we assume the input consists of UTF-8 encoded file4Returns the input too (convenient for type checking)NLoad something, exiting GenI if we have not been given the appropriate flag/Load something from a string rather than a file9The macros are stored as a hashing function in the monad.6Load something, but only if we are configured to do so4Entry point! (the most useful function to know here)AInitialises the realiser (lexical selection, among other things),8Runs the builder (the surface realisation engine proper)Unpacks the builder results0Finalises the results (morphological generation)In addition to the results, this returns a generator state. The latter is is mostly useful for debugging via the graphical interface. Note that we assumes that you have already loaded in your grammar and parsed your input semantics.simplifyResults  $ runGenI...'C for an easier time if you don't need the surface realiser stateThis is a helper to runGenIM. It's mainly useful if you are building interactive GenI debugging tools.Given a builder state,Unpacks the builder results0Finalises the results (morphological generation)\ performs lexical selection and strips the input semantics of any morpohological literalsSee   does any post-processing steps that we want to integrate into mainline GenI. So far, this consists of morphological realisation and OT rankingJShow the sentences produced by the generator, in a relatively compact form5No morphology! Pretend the lemma string is a sentence  n is most likely useful for grammars produced by a metagrammar system. Given a tree name, we retrieve the `trace' information from the grammar for all trees that have this name. We assume the tree name was constructed by GenI; see the source code for details.&We assume the name was constructed by  combineNameRuns the lexical selection (be it the standard GenI version or a custom function supplied by a user) and runs the results through the universal .&Also hunts for some warning conditions ]Standard GenI semantics and lexical selection algorithm (with optional "preanchored" mode)missingLiterals ts sem returns any literals in sem% that do not appear in any of the ts treesPost-processes lexical selection results to things which GenI considers universal. No matter what custom lexical selection mechanism you supply, these preflight checks will run.+attaches morphological information to treeshfilters out any elementary tree whose semantics contains things that are not in the input semanticsWNote that this affects the geniFlags; we assume the morph flags are not our businessyflag descriptionstring to loadflagflag null actionjobflagflagverbose file to load descriptionsummary parsing cmdtest-case-specific parameterstest-case-specific parameters handler for custom semantics semantics         ?V  ? V Q           None0HRun GenI without reading any test suites, just grab semantics from stdin'Run a test case with the specified nameRuns the tests specified in our instructions list. We assume that the grammar and lexicon are already loaded into the monadic state. If batch processing is enabled, save the results to the batch output directory with one subdirectory per suite and per case within that suite./<Return the batch directory or a temporary directory if unset0Used in processing instructions files. Each instruction consists of a suite file and a list of test case names from that fileSee  9http://projects.haskell.org/GenI/manual/command-line.htmlJ for how testsuite, testcase, and instructions are expected to interact-(Exported for use by regression testing code)Runs a case in the test suite. If the user does not specify any test cases, we run the first one. If the user specifies a non-existing test case we raise an error.DNot just the global warnings but the ones local to each response tooiTODO: If somebody puts together a render function that emits Data.Text we should just use that instead+,-.seconds/01raw text representation+-,./01.0+,-1/+,-./01 None234234234234!Safe56789:59678:56789:56789:/01/*23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmmnopqrstuvwxyz{|}~                                        P                   ! ! " " # # $ $ % % & & ' ' ( ( ) ) * * + + , , - - . . / / 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 : : ; ; < < = > ? @ @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                          P      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYYZ[\]^_`abcdefg(hijklmnoPpqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPPQRSTUUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~{.        !!!!!!!" "!"""#"$"%"&"'"(")"*"+",-./0/123/45/67/89:;/4</=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ/4[\]^_`abcdefgghij`klmnopqrstuvwxyz{/|}/|~HGFu#      !"#$%/&'()*+,-./00123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[/\]/\^/\_/\`/\a/\b/\c/\d/\e/\f/\g/\h/\ijkklYmnopqrstuvwxyz{|}~F/4/kkmkkm#GenI-0.25.0.1-RQPOUNtb6LG9Rr5zrmJjpNLP.GenI.ConfigurationNLP.GenI.PrettyNLP.GenI.StatisticsNLP.GenI.Polarity.TypesNLP.GenI.GeniShowNLP.GenI.GeneralNLP.GenI.ErrorIONLP.GenI.AutomatonData.FullList.InternalNLP.GenI.GeniVal.InternalNLP.GenI.FeatureStructure NLP.GenI.FlagNLP.GenI.LexicalSelection.TypesNLP.GenI.SemanticsNLP.GenI.Morphology.TypesNLP.GenI.Lexicon.InternalNLP.GenI.TreeSchema NLP.GenI.TagNLP.GenI.Polarity.InternalNLP.GenI.PolarityNLP.GenI.BuilderNLP.GenI.OptimalityTheoryNLP.GenI.ControlNLP.GenI.TestSuiteNLP.GenI.ParserNLP.GenI.MorphologyNLP.GenI.Simple.SimpleBuilderNLP.GenI.Warning.InternalNLP.GenI.LexicalSelectionNLP.GenINLP.GenI.Console NLP.GenI.MainBoolExp Paths_GenIParser Data.FullListNLP.GenI.GeniValNLP.GenI.Lexicon NLP.GenI.TagsmapBySemNLP.GenI.Warning Data.Monoidmempty ConfigurationOptimalityTheory customMorphbaseData.Typeable.InternalTypeable<>Metric IntMetricStatisticsState Statistics updateMetrics queryMetrics emptyStatsinitialStatisticsStateFor addMetricshowFinalStats incrIntMetricqueryIntMetric$fNFDataMetric$fNFDataStatistics$fJSONStatistics $fShowMetricPrettypretty prettyStrbetweenparenssquares<+>abovesqueezed prettyCount$fPrettyInteger $fPrettyInt $fPrettyText $fPretty[] PolarityAttrSimplePolarityAttrRestrictedPolarityAttrspkAtt_rpkCatrpkAttSemPols PolarityKey PolarityKeyAvPolarityKeyStrPolarityKeyVarreadPolarityAttrsshowPolarityAttrs$fNFDataPolarityAttr$fNFDataPolarityKey$fShowPolarityAttr$fPrettyPolarityKey$fEqPolarityKey$fOrdPolarityKey$fDataPolarityKey$fEqPolarityAttr$fOrdPolarityAttrGeniShowgeniShow geniShowText geniShowTree geniKeyword$fGeniShowTree BitVectorIntervalePutStr ePutStrLneFlushisGeniIdentLettertrimdropTillIncluding toUpperHead toLowerHead quoteStringmaybeQuoteText quoteTextclumpBy toAlphaNumfirst3second3third3fst3snd3thd3map'isEmptyIntersect groupByFMinsertToListMap histogrambuckets combinations mapMaybeMrepListmapTree' filterTree treeLeaves preTerminalsrepNode repAllNode listRepNode repNodeByNodehushgeniBugprettyException mkLogname!+!ival showInterval showBitVector $fOrdAlphaNum $fEqAlphaNum $fEqBitVector$fBitsBitVector$fNumBitVector$fNFDataBitVector liftEitherNFAstartSt isFinalSt finalStList transitionsstatesfinalSt lookupTransaddTransautomatonPathsautomatonPathSets numStatesnumTransitionsListable!:FullListfromFLindeedFLheadtail++sortNub$fBinaryFullList$fNFDataFullList$fListableFullList $fListable[]$fFunctorFullList $fEqFullList $fOrdFullList$fShowFullList$fDataFullListDescendGeniValdescendGeniVal SchemaValIdableidOf Collectablecollect CollectedVarUnificationResult SuccessSans SuccessRep SuccessRep2Failure MonadUnifySubstGeniValgLabel gConstraintsmkGConst mkGConstNonemkGVar mkGVarNonemkGAnon singletonValisAnon prettySubstunify allSubsume unifyHelper appendSubstprependToSubstunifyOneintersectConstraints subsumeOnereplace replaceOne replaceList replaceMapG replaceOneGanonymiseSingletonsfinaliseVarsById finaliseVarscrushOne crushList$fBinarySchemaVal$fBinaryGeniVal$fNFDataSchemaVal$fNFDataGeniVal$fDescendGeniValf$fDescendGeniValGeniVal$fGeniShowSchemaVal$fDescendGeniValSchemaVal$fCollectableSchemaVal$fCollectableGeniVal$fCollectable[]$fCollectableMaybe$fMonadUnifyEither$fGeniShowGeniVal$fPrettyGeniVal $fEqGeniVal $fOrdGeniVal $fDataGeniVal $fEqSchemaVal$fOrdSchemaVal FeatStructAvPairavAttavValFlistemptyFeatStruct mkFeatStructfromFeatStruct sortFlist unifyFeat alignFeat alignFeatH crushAvPair crushFlist$fNFDataAvPair$fBinaryAvPair$fGeniShowAvPair $fGeniShow[]$fPrettyAvPair$fCollectableAvPair$fDescendGeniVal(,)$fDescendGeniValAvPair $fGeniShowMap $fPrettyMap $fOrdAvPair $fEqAvPair $fDataAvPairWeirdFlgGrammarTypeFlg BuilderFlg ViewCmdFlg VersionFlgVerboseModeFlg TimeoutFlg TestSuiteFlgTestInstructionsFlg TestCaseFlg StatsFileFlgNoLoadTestSuiteFlgRootFeatureFlgRankingConstraintsFlg PartialFlg OutputFileFlgOptimisationsFlg MorphInfoFlg MorphCmdFlg MetricsFlg MaxResultsFlg MaxStepsFlg TracesFlg MacrosFlg LexiconFlgInstructionsFileFlgHelpFlg FromStdinFlg EarlyDeathFlgDumpDerivationFlgDetectPolaritiesFlg DisableGuiFlg BatchDirFlgHasFlagsflagsonFlagsFlag GrammarTypeGeniHand PreCompiled PreAnchored BuilderType SimpleBuilderSimpleOnePhaseBuilder Instruction OptimisationPolOptsAdjOpts Polarised NoConstraintsGuideddefaultGrammarTypegetGrammarTypehasOptisFlaghasFlag deleteFlag modifyFlagsetFlaggetFlag getAllFlags getListFlag updateFlags$fEqFlag $fHasFlags[]$fShowBuilderType$fShowOptimisation$fEqOptimisation$fEqBuilderType$fShowGrammarType$fEqGrammarType$fEqBatchDirFlg$fEqDisableGuiFlg$fEqDetectPolaritiesFlg$fEqDumpDerivationFlg$fEqEarlyDeathFlg$fEqFromStdinFlg $fEqHelpFlg$fEqInstructionsFileFlg$fEqLexiconFlg $fEqMacrosFlg $fEqTracesFlg$fEqMaxStepsFlg$fEqMaxResultsFlg$fEqMetricsFlg$fEqMorphCmdFlg$fEqMorphInfoFlg$fEqOptimisationsFlg$fEqOutputFileFlg$fEqPartialFlg$fEqRankingConstraintsFlg$fEqRootFeatureFlg$fEqNoLoadTestSuiteFlg$fEqStatsFileFlg$fEqTestCaseFlg$fEqTestInstructionsFlg$fEqTestSuiteFlg$fEqTimeoutFlg$fEqVerboseModeFlg$fEqVersionFlg$fEqViewCmdFlg$fEqBuilderFlg$fEqGrammarTypeFlg $fEqWeirdFlgLexCombineError2 EnrichError StringErrorLexCombineError BoringErrorFamilyNotFoundError SchemaError PathEqPair TopBottomTopBottom NodePathEqLhsPeqFeatPeqLex PathEqLhs PeqInterfacePeqJust PeqUnknown parsePathEq showPathEqLhsshowLexCombineErrorcompressLexCombineErrors$fPrettyLexCombineError2$fPrettyLexCombineError $fPosetText$fPosetPathEqLhs$fPosetLexCombineError2$fPosetLexCombineError $fEqTopBottom$fOrdTopBottom$fEqNodePathEqLhs$fOrdNodePathEqLhs $fEqPathEqLhs$fOrdPathEqLhs$fEqLexCombineError2$fOrdLexCombineError2$fEqLexCombineError HasConstants constantsSemInput LitConstrSemLiterallHandle lPredicatelArgs emptyLiteralremoveConstraintssortSemcompareOnLiteralsortByAmbiguitydisplaySemInputisInternalHandle subsumeSem subsumeSemHsubsumeLiteralunifySem unifySemH unifyLiteral$fBinaryLiteral$fNFDataLiteral $fGeniShow(,)$fGeniShow(,,) $fPretty(,,)$fGeniShowLiteral$fPrettyLiteral$fDescendGeniValLiteral$fHasConstantsLiteral$fHasConstants[]$fHasConstantsGeniVal$fCollectableLiteral $fOrdLiteral $fEqLiteral $fDataLiteralLemmaPlusSentence LemmaPluslpLemmalpFeats MorphOutput moWarningsmoRealisations MorphRealiser MorphInputFn$fNFDataLemmaPlus$fNFDataMorphOutput$fOrdMorphOutput$fEqMorphOutput $fEqLemmaPlus$fOrdLemmaPlusPolValueLexEntryiwordifamnameiparams iinterfaceifilters iequations isemanticsisempolsLexicon mkLexEntrymkFullLexEntry fromLexSemfromLexLiteral$fNFDataLexEntry$fBinaryLexEntry$fPrettyLexEntry$fGeniShowLexEntry$fCollectableLexEntry$fDescendGeniValLexEntry $fEqLexEntry$fDataLexEntryNodeNameGTypeSubsFootLexOtherGNodeGNgnnamegupgdownganchorglexemegtypegaconstrgoriginAdjunctionConstraintMaybeAdj ExplicitNoAdj InferredNoAdjPtypeInitialAuxiliarTtreeTTparamspfamilypidname pinterfaceptype psemanticsptracetreeMacros SchemaTreerootrootUpdfoot setAnchor setLexemeisAdjConstrainedaddInferredAdjConstraintgnnameIs gCategorylexemeAttributes showLexemecrushTreeGNode crushGNode $fNFDataGNode $fNFDataPtype $fNFDataGType $fBinaryTtree$fNFDataAdjunctionConstraint$fBinaryAdjunctionConstraint $fBinaryGType $fBinaryGNode $fBinaryPtype$fGeniShowGNode $fPrettyGNode$fGeniShowTtree$fGeniShowPtype$fDescendGeniValGNode$fCollectableGNode$fCollectableTree$fDescendGeniValMap$fCollectableTtree$fDescendGeniValTtree $fShowPtype $fEqPtype $fDataPtype $fDataTtree $fEqTtree$fEqAdjunctionConstraint$fDataAdjunctionConstraint $fShowGType $fEqGType $fDataGType $fEqGNode $fDataGNodeTagItemtgIdNametgIdNum tgSemanticstgTreeDerivationStepSubstitutionStepAdjunctionStepInitStep TagDerivationTagElemTEidname ttreenametidnumttypettree tsemantics tpolarities tinterfacettracetsempolsTagSitetsNametsUptsDowntsOriginTags addToTags detectSites toTagSitedsChilddsParent dsParentSiteplugTree spliceTree setTidnums tagLeaves getLexemets_synIncompletets_tbUnificationFailurets_rootFeatureMismatchts_semIncomplete$fNFDataDerivationStep$fNFDataTagElem$fGeniShowTagElem$fTagItemTagElem$fIdableTagElem$fCollectableTagElem$fDescendGeniValTagSite$fDescendGeniValTagElem $fOrdTagElem$fJSONDerivationStep $fEqTagSite $fOrdTagSite $fDataTagSite $fEqTagElem $fDataTagElem$fShowDerivationStep$fOrdDerivationStep$fEqDerivationStepPolMapSemMapPolarityDetectionResult PD_UserError PD_NothingPD_JustPD_UnconstraineddetectRootCompensation detectPolsHdetectPolaritytoZero substNodes substTops polarityKeysconvertUnconstrainedPolaritiesaddPolsnubAut__cat____idx__ pdResultspdToListPolAutPolStatePolSt PolPathSetAutDebug PolResultprIntermediate prInitialprFinalprSembuildAutomaton makePolAut fixPronounsdetectIdxConstraintsdeclareIdxConstraintssuggestPolFeatures detectSansIdx detectPolsdetectPolPaths emptyPolPaths polPathsNullpolPathsToList unionPolPathsintersectPolPathshasSharedPolPathsprettyPolPathssingletonPolPath $fOrdPolState$fShowPolState $fEqPolState FilterStatusFiltered NotFilteredDispatchFilter SemBitMap BuilderStateUninflectedDisjunction SentenceAutInput inSemInputinLexinCandsOutputBuilderinitstepstepAllfinishedunpackpartial GenStatusFinishedActiveErrorpreInitunlessEmptySemrundefineSemanticBitssemToBitVectorbitVectorToSemdefaultStepAll>--> condFilter incrCounter queryCounter initStatsdefaultMetricNamesnum_iterations chart_sizenum_comparisonslexicalSelection $fNFDataInput$fPrettyGenStatus#$fCollectableUninflectedDisjunction&$fDescendGeniValUninflectedDisjunction$fDataUninflectedDisjunctionOtResult GetTraces OtViolation OtRankingRankedOtConstraint OtConstraint PositiveC NegativeC NegativeConjC otWarnings rankResultsprettyViolations prettyRank$fNFDataOtConstraint$fNFDataRankedOtConstraint$fNFDataOtViolation$fPrettyOtConstraint$fPrettyRankedOtConstraint$fJSONOtViolation$fJSONRankedOtConstraint$fJSONOtConstraint$fOrdRankedOtConstraint2$fOrdRankedOtConstraint$fShowOtConstraint$fEqOtConstraint$fShowRankedOtConstraint$fEqRankedOtConstraint$fEqRankedOtConstraint2$fShowOtViolation$fEqOtViolation$fOrdOtViolation $fOrdLexItem $fEqLexItem $fShowLexItemParams builderType morphFlags geniFlagsranking updateParams$fHasFlagsParamsTestCasetcName tcSemStringtcSem tcExpectedtcParams$fPrettyTestCase$fGeniShowTestCasegeniLanguageDef geniValue geniFeats geniSemanticsgeniSemanticInput geniTestSuitegeniTestSuiteStringgeniDerivations geniWordsgeniWord geniLexicon geniMacros geniTagElems geniMorphInfotillEof parseFromFile$fGeniValLikeSchemaVal$fGeniValLikeGeniVal$fEqAnnotation emptyParamsgetBuilderType getRankingoptionsForStandardGenI basicSectionsoptionsSections nubBySwitchesnoArgreqArgoptArgusage treatArgstreatArgsWithParams defineParamsoptionsForBasicStuffoptionsForInputFiles macrosOption lexiconOption helpOption verboseOptionoptionsForOptimisationparseFlagWithParsecoptionsForBuildermainBuilderTypesoptionsForTestingoptionsForMorphologyprocessInstructionsreadGlobalConfig setLoggers$fIsStringYamlLight $fReadLogFmt $fReadLogTo $fShowLogTo $fShowLogFmt$fShowLoggerConfig readMorph stripMorphSem attachMorphsetMorphAnchor sansMorphinflectSentencesUsingCmd$fJSONLemmaPlus$fJSONMorphOutput SimpleGuiItem siHighlight siDiagnostic siFullSemsiIdname SimpleItemsiId siSubstnodes siAdjnodes siSemantics siPolpathssiNodes siDerivedsiRoot_siFoot_ siPendingTb siDerivation siGuiStuff SimpleStatus theAgenda theHoldingPentheCharttheTrash theResults genconfig SimpleStateChart AuxAgendaAgendasimpleBuilder_2psimpleBuilder_1p simpleBuilder addToAgenda addToCharttestEmptySimpleGuiIteminitSimpleBuildertestIapplyAdjNode testCanAdjoin unpackResult$fDescendGeniValSimpleItem$fShowGenerationPhase$fDataSimpleGuiItemWordFamilyCount LexWarningLexCombineAllSchemataFailedLexCombineOneSchemaFailedMissingCoanchors GeniWarningCustomLexWarningNoLexSelection MorphWarning GeniWarningsfromGeniWarningsmkGeniWarningsposort sortWarnings appendWarning mergeWarningshowGeniWarning toWfCount$fPosetLexWarning$fPosetGeniWarning$fMonoidGeniWarnings$fEqLexWarning$fEqGeniWarningEnrichmentResult EnrSuccess EnrNotFound EnrFailed LexCombineLexicalSelection lsAnchored lsLexEntries lsWarningsLexicalSelector CustomSemfromCustomSemInputcustomSelectorcustomSemParsercustomSuiteParsercustomRenderSemdefaultLexicalSelectordefaultLexicalSelectionmissingLexEntriesdefaultLexicalChoice chooseCandI mergeSynonyms runLexCombinelexTelldefaultAnchoring combineList combineOneenrichenrichBy maybeEnrichBy enrichFeatmissingCoanchors lexEquations seekCoanchor matchNodeNamematchNodeNameHelper setLemAnchors _lemanchor setOrigindefaultPostProcessingpreselectParaphrasesrespectsConstraints ResultTypeCompleteResult PartialResult GeniLexSelnlTreenlTrace GeniSuccessgrLemmaSentencegrRealisations grResultType grWarnings grDerivationgrOrigingrLexSelection grRanking grViolations GeniError GeniResultGErrorGSuccess GeniResults grResultsgrGlobalWarnings grStatisticsBadInputExceptionLoadablelParselSet lSummarise ProgStateRef ProgStatepagrlemorphinftracesemptyProgStateloadEverythingloadFromString loadLexiconloadGeniMacros loadRanking loadTestSuite parseSemInput isSuccessrunGenisimplifyResultsextractResultsinitGenishowRealisationslemmaSentenceString prettyResult getTracesdefaultCustomSem$fNFDataGeniLexSel$fNFDataResultType$fNFDataGeniError$fNFDataGeniSuccess$fNFDataGeniResult$fJSONGeniLexSel$fJSONResultType$fJSONGeniError$fJSONGeniSuccess$fJSONGeniResult$fJSONGeniResults$fLoadablePreAnchoredL$fPrettyGeniError$fLoadableTestSuiteL $fLoadable[]$fLoadableTracesL$fLoadableMorphFnL $fLoadable[]0 $fLoadable[]1$fExceptionBadInputException$fHasFlagsProgState$fShowBadInputException$fOrdGeniError $fEqGeniError$fOrdGeniLexSel$fEqGeniLexSel$fOrdResultType$fEqResultType$fOrdGeniSuccess$fEqGeniSuccess$fOrdGeniResult$fEqGeniResultRunAs Standalone PartOfSuite consoleGeni getBatchDir loadNextSuite writeResultsmain mainWithState forceGuiFlagCondAndOrNotcheckcatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNameStatmetrics metricToJSON jsonToMetricGHC.ShowShowAlphaNumGHC.Basemap Data.OldListgroupByGHC.ListfilterANNothing Data.Foldableelem#text-1.2.2.2-KC7dWoG09dA1F6jKj5GSqhData.Text.InternalTextdsOpnmatch findSubTree firstMaybe buildColumnsprune indexLiteral assignIndexpolstart PolTransFnPolTrans PolPathMap SemWeightMapPredLite buildSeedAut buildSeedAut'buildSeedAutHelper buildPolAut buildPolAut'buildPolAutHelperprune' isExtraColidxConstraintKey sortSemByFreq fakestateid modifyStats namedMetricgen_time otLexNameRankedOtConstraint2 posViolations negViolationssortedViolations sortResultssortAndGroupByDecorationwordWrapLexItemlLexnamelTracesotConstraintViolated violations lexTraces toLexItemrankedOtConstraintToPairs neverViolatednonExistentTracescTraces concatRanknoRankindentedspaces splitAtBefore AnnotationgeniSemanticInputStringgeniTestCaseString geniParams geniPolarityGHC.Num+-flexiIdentifier identifierlooseIdentifierlooseFlexiIdentifier identifierR AnnoAnchor AnnoLexeme AnnoSubstAnnoFoot AnnoDefaultTestCaseOutput GeniValLike geniValueLikegeniAtomicDisjunctiongeniFancyDisjunction geniAttVal geniLiteral geniLiteral_geniIdxConstraints squaresString geniTestCase geniOutput geniTraces withWhite geniSentencegeniLexicalEntrygeniLexSemanticsgeniLexLiteral geniPolValueinitTypeauxType geniTreeDefgeniTreegeniNodefromAnnotationgeniNodeAnnotation geniTagElem morphEntrykeywordkeywordSemanticslexer whiteSpacecolon stringLiteralbracesreservedsymboldecode$parsec-3.1.11-DytKT37FVYQJRVdRwnazC8Text.Parsec.Pos SourcePosColumnLine SourceName sourceName sourceLine sourceColumn incSourceLineincSourceColumn setSourceName setSourceLinesetSourceColumnText.Parsec.Error ParseErrorerrorPosText.Parsec.PrimState stateInputstatePos stateUser unexpected<|>labellabelstokens lookAheadtoken tokenPrim tokenPrimExmanyskipManyparse parseTest getPositiongetInput setPositionsetInputgetParserStatesetParserStategetStatesetState updateStateText.Parsec.Combinatorchoiceoption optionMaybeoptional skipMany1many1sepBysepBy1 sepEndBy1sepEndByendBy1endBycountchainrchainlchainl1chainr1anyTokeneof notFollowedBymanyTillText.Parsec.CharoneOfnoneOfspacenewlinetabupperloweralphaNumletterdigithexDigitoctDigitcharanyCharsatisfystring endOfLinecrlfText.Parsec.Text GenParser modifyStateputStateupdateParserState runParser runParserTrunPrunPT manyAccumtry parserPlus parserZero parserFailmergeErrorReply parserBind parserReturn parsecMapmkPT runParsecTsysUnExpectError unknownErrorParsecTParsecConsumedEmptyReplyOkStreamunconsusageForOptimisationsreadOptimisationsparseOptimisationsGHC.ErrerrormReadBuilderTypereadBuilderTypeLogFmt LogFmtNull LogFmtSimpleLogTo LogToFileLogToErr LoggerConfiglcName lcPriority lcHandler lcFormatter OptSectiondefaultBuilderType emptyFlags getSwitches usageSectioninstructionsOption tracesOption rankingOptionoptionsForOutput partialOption outputOptionoptionsForUserInterface noguiOption versionOptiondefaultPolarityAttrsexampleRootFeatdefaultRootFeatrootFeatureOptioncoreOptimisationCodesoptimisationCodespolOptsadjOpts lookupOpt showOptCode describeOptlookupOptimisationfromStdinOptiontestSuiteOptionmaxResultsOptionmaxStepsOptionmorphInfoOptioninstructionsFilelogDefaultConfigsetGeniHandlerreadsQuotedStringPrec loggerConfig singleton maybeRead dropPrefixSystem.Console.GetOptgetOpt'getOpt usageInfoArgOrder RequireOrderPermute ReturnInOrderOptDescrOptionArgDescrNoArgReqArgOptArgattachMorphHelperMNAME parsecToJSONlognamegrPaths LifoAgenda GrLifoAgendaclosedaux closedAux initGrPathsmarkNonAdjunctionSites selectGiven selectLifo selectGuided iapplySubstsansAdjunction1psansAdjunction2ptrashTbUnificationErrordetectNa lookupChartcombineSimpleItems constrainAdj dpTbFailuredpRootFeatFailureTbEitherSimpleDispatchFilterChartIdStsem gencounter semBitMapGenerationPhaseSubstitutionPhaseAdjunctionPhaseTrashAgendaStrategyagendaStrategyisAdjunctionPhase assignNewId updateAgendaaddToAuxAgenda addToTrash addToResults lookupOrBugsiRootsiFootemptySimpleGuiItemmodifyGuiStuffadjdone siInitialinitSimpleIteminitSimpleGuiItemrenameNodesWithTidnumgenerateStep_1pgenerateStep_2pgenerateStep_2p_subgenerateStep_2p_adjtrashIt missingSem switchToAux semfilterapplySubstitutionapplySubstitution1papplyAdjunction2ppassiveAdjunction1pactiveAdjunction1pvalidAuxtryAdj iapplyAdjNode canAdjoinisRootOffilterCompatiblecombineSimpleGuiItemsaddToDerivationsimpleDispatch_2psimpleDispatch_2p_adjphasesimpleDispatch_1psimpleDispatch dpToAgenda dpToResults dpToTrashdpAux dpTbNaFailuretbUnifyNaNodes tbUnifyTree tbUnifyNode unpackResultsemptyFeatureStrlistToSentenceAutpartialResultscoverage countBitsMonoidGHC.IOFilePathghc-prim GHC.TypesTruelParseFromFile lSetState loadOrDie loadOptionalfinaliseResults readPidnamerunLexSelectionfinaliseLexSelectionmissingLiterals PreAnchoredL TestSuiteLfromTestSuiteLTracesLMorphFnLLthrowOnParseError loadMorphInfo loadTraces fromParsecresultToEither2withFlagwithFlagOrIgnore withFlagOrDiewithLoadStatusparseFromFileMaybeBinarymkDefaultCustomSemreadPreAnchoredmkPreAnchoredLexicalSelector readFileUtf8 verbosity picosToMillisrunStdinTestCaserunSpecificTestCaserunInstructions runOnSemInput allWarningsppJSONwithGeniTimeOutrunAsStandalone writeFileUtf8 putStrLnUtf8