CSPM-Frontend-0.3.0.3: A CSP-M parser compatible with FDR-2.83

PortabilityGHC-only
Stabilityexperimental
MaintainerFontaine@cs.uni-duesseldorf.de

Language.CSPM.Rename

Description

Compute the mapping between the using occurences and the defining occurences of all Identifier in a Module Also decide whether to use ground or non-ground- representaions for the translation to Prolog.

Synopsis

Documentation

getRenaming :: LModule -> Either RenameError (Bindings, AstAnnotation UniqueIdent, AstAnnotation UniqueIdent)Source

getRenaming computes two AstAnnotations. The first one contains all the defining occurences of identifier The second one contains all the using occurences of identitier. getRename returns an RenameError if the Module contains unbound identifiers or illegal redefinitions.

applyRenaming :: (Bindings, AstAnnotation UniqueIdent, AstAnnotation UniqueIdent) -> LModule -> LModuleSource

applyRenaming uses SYB to replace turn every Ident in the Module into to the UIdent version, i.e. set the UniqueIdent. At the same time, we also replace VarPat x with ConstrPat x if x an toplevel constant It is an error if the Module contains occurences of Ident that are not covered by the AstAnnotations.