CSPM-Frontend-0.6.8.0: A CSP-M parser compatible with FDR-2.91

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 :: ModuleFromParser -> 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) -> ModuleFromParser -> ModuleFromRenamingSource

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.

type ModuleFromRenaming = Module FromRenamingSource

A module that has gone through renaming

data FromRenaming Source

Tag that a module has gone through renameing.