This library defines a representation for Prolog programs. It does not cover all aspects of Prolog but might be useful for applications generating Prolog programs.
Author: Michael Hanus
Version: November 2020
Constructs a Prolog list object from a list of Prolog terms.
A Prolog clause is either a program clause consisting of a head and a body, or a directive or a query without a head.
PlClause :: String -> [PlTerm] -> [PlGoal] -> PlClause
PlDirective :: [PlGoal] -> PlClause
PlQuery :: [PlGoal] -> PlClause
A Prolog goal is a literal, a negated goal, or a conditional.
PlLit :: String -> [PlTerm] -> PlGoal
PlNeg :: [PlGoal] -> PlGoal
PlCond :: [PlGoal] -> [PlGoal] -> [PlGoal] -> PlGoal
A Prolog term is a variable, an atom, a number, or a structure.
PlVar :: String -> PlTerm
PlAtom :: String -> PlTerm
PlInt :: Int -> PlTerm
PlFloat :: Float -> PlTerm
PlStruct :: String -> [PlTerm] -> PlTerm