Module Language.Prolog.Goodies

Author
Michael Hanus
Version
January 2022

This library defines operations to support the construction and analysis of Prolog programs.

Selector operations on Prolog programs


plList :: [PlTerm] -> PlTerm  Deterministic 

Constructs a Prolog list object from a list of Prolog terms.


isPlVar :: PlTerm -> Bool  Deterministic 

Is a Prolog term a variable?


rootOf :: PlTerm -> (String, Int)  Deterministic 

The name and the arity of the root of a Prolog term, where the names of variables are ignored (i.e., empty).


argsOf :: PlTerm -> [PlTerm]  Deterministic 

The arguments of a Prolog term.


goalVars :: PlGoal -> [String]  Deterministic 

The set of all variables occurring in a Prolog goal.


termVars :: PlTerm -> [String]  Deterministic 

The set of all variables occurring in a Prolog term.


termsVars :: [PlTerm] -> [String]  Deterministic 

The set of all variables occurring in a list of Prolog terms.


termVarOccs :: PlTerm -> [String]  Deterministic 

The multi-set of all occurrences of variables in a Prolog term.


goalConstrs :: PlGoal -> [(String, Int)]  Deterministic 

The set of all data constructors together with their arities used in a Prolog goal.


termConstrs :: PlTerm -> [(String, Int)]  Deterministic 

The set of all data constructors together with their arities used in a Prolog term.