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: May 2017
plList
:: [PlTerm] -> PlTerm
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.
Constructors:
PlClause
:: String -> [PlTerm] -> [PlGoal] -> PlClause
PlDirective
:: [PlGoal] -> PlClause
PlQuery
:: [PlGoal] -> PlClause
A Prolog goal is a literal, a negated goal, or a conditional.
Constructors:
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.
Constructors:
PlVar
:: String -> PlTerm
PlAtom
:: String -> PlTerm
PlInt
:: Int -> PlTerm
PlFloat
:: Float -> PlTerm
PlStruct
:: String -> [PlTerm] -> PlTerm