Module Prolog.Types

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

Summary of exported operations:

plList :: [PlTerm] -> PlTerm   
Constructs a Prolog list object from a list of Prolog terms.

Exported datatypes:


PlClause

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

PlGoal

A Prolog goal is a literal, a negated goal, or a conditional.

Constructors:


PlTerm

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

Exported operations:

plList :: [PlTerm] -> PlTerm   

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