Purity: A Horn Clause Only library for Prolog
Up: Purity
Domains
A domain contains facts and rules about a particular type of knowledge. From Purity's point of view, a domain is a type of data, but custom domains can be created to contain any set of facts and rules. Several library calls in Purity have a domain as a paramter and this call will usually use the domain parameter to do comparisions.
The following domains come standard with the Purity library:
-
pbool
- boolean operators of which can betrue
orfalse
-
pchar
- A domain containing the following characters:- The character set
[a-zA-Z0-9]
- The digits
[0-9]
- The following symbols
;:",?/\<>,.!@#$%^&*()[]{}|-_+=
- Whitespace characters
<space>\n\r\t
- The character set
-
pstring
- Strings which are represented by a list ofpchar
characters. pstring is the equivilent ofplist(pchar)
when using comparisions, however there are a special set of APIs that start withpstr_
that only use thepstring
domain. -
plist(D)
- Lists which can be of type D where D is a domain. -
punary
- Unary numbers (or natural numbers) using church encoding- zero = 0
- c(zero) = 1
- c(c(zero)) = 2
- etc..