úÎUxT     «models a Lattice for a context type, the top of the lattice is represented by One and inherits a list of all subcontexts, the bottom of the lattice is represented by Zero.hahn@geoinfo.tuwien.ac.atbetaNone)236 Tdata type to represent a lattice structure, the actual context is the type variable cMconstructor represents the bottom element of the lattice, without any contextconstructor for one context›constructor represents the One element of the lattice, all contexts are included in this constructor, for this constructor the model includes all contexts]extracts a context list of contexts from the element, needed for the One wrapper constructor0makes a list of contexts for the One constructor%takes a context and returns all finerÿ Checks if the first context list is included in the second, if so the context is returned, so far the function is does not have any order restrictions (is commutative) checks also sublists, if an element of a sublist is in both lists, the whole list is includedtest for commutativityÿø(Ctx [Walking]) `propCommutative` One [Ctx [Walking],Ctx [Driving],Ctx [Walking,Driving],Ctx [Uphill],Ctx [Walking,Uphill],Ctx [Driving,Uphill],Ctx [Walking,Driving,Uphill]] = (Ctx [Walking]) `meet` One [Ctx [Walking],Ctx [Driving],Ctx [Walking,Driving],Ctx [Uphill],Ctx [Walking,Uphill],Ctx [Driving,Uphill],Ctx [Walking,Driving,Uphill]] == One [Ctx [Walking],Ctx [Driving],Ctx [Walking,Driving],Ctx [Uphill],Ctx [Walking,Uphill],Ctx [Driving,Uphill],Ctx [Walking,Driving,Uphill]] `meet` (Ctx [Walking])truetest for idempotencyZpropIdempotent (Ctx [Walking]) = (Ctx [Walking]) `meet` (Ctx [Walking]) == (Ctx [Walking])truetest for associativityÂpropAssociative (Ctx [Walking]) (Ctx [Driving]) (Ctx [Uphill]) = (Ctx [Walking]) `meet` ((Ctx [Driving]) `meet` (Ctx [Uphill])) == ((Ctx [Walking]) `meet` (Ctx [Driving])) `meet` (Ctx [Uphill])true0checks in which level of the lattice the actual  Context c? is One gets level 1, Zero gets level 0, and all others are 1+Omakes the Context c type to a MeetSemiLattice by implementing the meet function *Context where elements are extracted from,extracted context list*list of context c occured by constructor cextracted listcontext that is used as start?all finer contexts of the start context included in the lattice3first list that is used to check against second onesecond list is like a reference(elements that are included in both lists context one context two#true if the property is full-filledcontext to test#true if the property is full-filled context one context two context three#true if the property is full-filled%context to check level in the latticelevel in the lattice   Wconnects the context Lattice with observation frequencies of exemplars using a multisethahn@geoinfo.tuwien.ac.atbetaNone36 Hthe class defines the necessary functions needed for the context algebra #type synonym for better readability &All experiences are hold in a multiset `Each experience is formed by a exemplar of type e and a context c this exemplar was observed at. Fconstructor; establishes an experience from a context and an exemplar<combines the observation amount of exemplars for one contextJIf an experience is made several times the amount can be specified by the amount5calculates the amount of experiences that are present¢filters experiences for a context, gets experiences for a finer context, the context c has to be more finer than the context that are included in the experiencesTreturns a probability of an exemplar observed in a context for the given experiencesAreturns experiences for the exemplar given in the first argument e' in quantum mechanics called projectorareturns the observation distribution for the context c, the type e is only used as type parameterYreturns the most probable exemplar given by the list of tuples of (Exemplar, Probability)'converts the experiences type to a IO() adds the new$ experience to the given experiences *context in which the experiences were madeexemplars which are observed7amount of observations for one exemplar in this contextresulting experience type)experience that is observed several times(amount of observations of the experience*experiences with the given amount and typeexperinces to be countedamount of experiences&context used to filter the experiencesexperiences to filter9filtered experiences, more finer experiences are returned exemplar and context to look forexperiences that are consideredEprobability of the exemplar in this context for the given experiences'exemplar used to filter the experiencesexperiences that are filtered/experiences including values for the exemplar e$context the distribution is made for%exemplar type, used as type parameter'experiences the distribution is made ofreturned distribution5list of tupels of Exemplars and the probability value(tupel with the highest probability valueexperience to convert to IO returned IO()new experience to add1given experiences where to add the new experienceAresulting experiences including the new and the given experiences         ContextAlgebra-0.1.0.0ContextLatticeModelContextZeroCtxOneextractContextgetFinerContextspropCommutativepropIdempotentpropAssociativeInterpretationModel Probability Experiences ExperienceExpcreateExperiencesForContextmanyfoldExperiencesamountExperienceslambdamufilterExemplarsprobAllExemplars4ContextgetMostProbableExemplarprintExperiences addExperienceextractOneContextisPartOflevel$fMeetSemiLatticeContext