-
Notifications
You must be signed in to change notification settings - Fork 0
function overview
- data SDRSRelation = SDRSRelation {...}|Outscopes
- data RelType = Crd|Sub
- type DisVar = Int
- type Label = String
- data SDRSFormula = Segment {...}|Relation {...}|And {...}|Not {...}
- data SDRS = SDRS {...}
- type DGraph = M.Map DisVar [(DisVar, SDRSRelation)]
**** Binding ****
-
noUndeclaredVars :: SDRS -> Bool
-- Checks if all labels are declared in an SDRS, i.e. that LAST is part of the keys
-- of the map and that the arguments of all relations are as well
-> split functionality / simplify? -
noSelfRefs :: SDRS -> Bool
-- Returns whether a given SDRS has any self referencing relations
-> -
allSegmentsBound :: SDRS -> Bool
-- Checks whether all Segments (directly labeled and labeled in recursive SDRSFormulas) are bound in a Relation.
-> FIX recursive Segments
**** Composition ****
-
buildFromDRSs :: SDRSRelation -> DRS -> DRS -> SDRS
-- Build new SDRS using two DRSs and their relation
-> -
addDRS
-- Adds a new 'DRS' @d@ to a given 'SDRS' @s@, using the given set of edges.
-- If the argument that is to be attached to in the set of edges is already part
-- of the SDRS, conjunct the newly created relation to the relations at this level.
-> TODO re-implement, TODO prechecks? SDRS must be well-formed to receive new DRSs?
**** DiscourseGraph ****
-
discourseGraph :: SDRS -> DGraph
-- Given an SDRS, build a labeled graph structure, consisting of a tuple
-- of the graph itself and the last node
-> -
immediateOutscopes :: SDRS -> M.Map DisVar [DisVar]
-- Given an 'SDRS', returns a map from 'DisVar's to 'DisVar's that they outscope
-> -
accessibleNodes :: SDRS -> DisVar -> [DisVar]
-- Given an 'SDRS' and a discourse variable, lists the accessible
-- variables from this variable in order of proximity to local discourse
-- variable, with the first entry being the farthest and the last the closest
-> CHECK influence by structural rels? (def. 15 book) -
rf :: SDRS -> [DisVar]
-- computes the right frontier of an 'SDRS', in order of locality
-> simplify?, DEBUG structural checks, FIX if last is wrong or unvalid, this function will return nonsense -
root :: SDRS -> [DisVar]
-- Return the root node of the discourse graph. If the graph doesn't have
-- a single node that dominates all subelements. The return type is list
-- to account for the (infelicitous) case where there is more than one root
-- node or nodes in the graph that are unconnected (thus root nodes of a separate
-- graph).
->
**** LambdaCalculus ****
-
sdrsAlphaConvert :: SDRS -> M.Map DisVar DisVar -> SDRS
-- Applies alpha conversion to an 'SDRS' on the basis of a conversion list
-- for all embedded 'DisVar's.
-> -
normalize :: SDRS -> SDRS
-- normalizes the nodes in an SDRS using sdrsAlphaConvert.
->
**** Merge ****
- sdrsMerge :: SDRS -> SDRS -> SDRSRelation -> SDRS
-- Applies merge to 'SDRS' @s1@ and 'SDRS' @s2@. The latter is attached
-- with node @dv2@ to @dv1@ of @s1@, using relation @r@.
-> TODO do wellformedness checks before merge?
**** Properties ****
-
sdrsProperDRSs :: SDRS -> Bool
-- Checks, given an 'SDRS', whether all embedded DRSs are proper
-> -
sdrsPureDRSs :: SDRS -> Bool
-- Checks, given an 'SDRS', whether all embedded DRSs are pure
-> -
sdrsAllDRSRefUnique :: SDRS -> Bool
-- Checks if the 'SDRS' @s@ only has unique DRSRefs where, i.e.:
-- * no embedded 'DRS' declares 'DRSRef's that are declared in any other
-- embedded 'DRS' of @s@.
-> -
validLast :: SDRS -> Bool
-- checks whether the discourse unit pointed to by LAST is meaningful, i.e.
-- * that it is an EDU, i.e. a Segment denoting a DRS, and
-- * that it is part of a relation, in which it is not the left argument
-> TODO re-implement using RF (which it currently has interactions with, meaning that LAST is by definition on RF) -
struc_isomorph :: SDRS -> SDRS -> Bool
-- Checks whether two 'SDRS's @s1@ and @s2@ are isomorph, i.e., their
-- graph structure does not differ except for different labeling of DUs
-> first version by hand -
struc_isomorph2 :: SDRS -> SDRS -> Bool
-- alternative version using alpha conversion
->
**** String **** -> equivalent structure to DRS and PDRS
- stringToSDRS :: String -> SDRS
- parseSDRS
- parseMap :: String -> M.Map DisVar SDRSFormula
-- parses map of an SDRS - parseLast :: String -> DisVar
-- parses Last node of an SDRS
**** Structure ****
-
sdrsMap :: SDRS -> M.Map DisVar SDRSFormula
-- Returns the map of an SDRS
-> CHECK: Are such methods encouraged? It's for cases where I can't pattern match -
sdrsLast :: SDRS -> DisVar
-- Returns last
-> same as sdrsMap -
dus :: SDRS -> [DisVar]
-- returns set of DUs (keys of map)
-> needed? -
lookupDU :: SDRS -> DisVar -> Maybe SDRSFormula
-- Returns a certain discourse unit if present
-> needed? -
lookupKey :: SDRS -> DisVar -> DisVar
-- Lookup the DisVar that labels the relation where the given DisVar is
-- an argument of
-> TODO rename to avoid confusion with lookup behavior? needed? -
relLabels :: [SDRSFormula] -> [DisVar]
-- Returns all labels that are arguments of relations
-> -
relations :: SDRS -> [(DisVar, SDRSFormula)]
-- Lists, given an SDRS, its relations along with each respective label
-> -
segments :: SDRS -> [(DisVar, SDRSFormula)]
-- equiv to relations just with segments
-> -
drss :: SDRS -> [DRS]
-- lists all embedded DRSs
->
-
sdrsMap/sdrsLast -> encouraged?
-
validLast/RF/root interaction -> RF is implemented by searching an SDRS upwards from the last node on. Thus LAST is always on RF (we talked about this as a possible constraint for LAST which would checking whether it is on right side of relation redundant)
-
addDRS
- functionality for relation restructuring on update incomplete
- how to include SDRSFormula negation?
-
isRFCCompliant
- a function for checking if all drs attachments in an sdrs comply to the rfc
- what will be the theoretic foundation of this check?
-
unresolved structures
-
isWellformedSDRS
- a high-level function combining several sdrt properties checks
-
Input
- String.hs: decide on syntax, especially for And and Not
- other input methods?
-
Show
- SDRS with underspecified DRSs
- Debug/Set output?
-
Translate
- Translate to what? FOL isn't possible, right? What else?