YAP 7.1.0

Symbols and associated propeeties. More...

Detailed Description

Symbols and associated propeeties.

Prolog interns symbols, called atoms in a Hash table, usually called the atom table_ Each entry in this table stores the atom's name, but also may have a linked list of properties We use properties to represent all kinds of data including data-base tecords, predicates operators, and more

In a nutshell:


Class Documentation

◆ YAPAtom

class YAPAtom

Atom A YAP data-base is a collection of atoms, where each atom has a name and a set of Properties.

Examples of properties include functors, predicates, operators, modules, almost everything

Definition at line 71 of file yapa.hh.

Public Member Functions

 YAPAtom (const char *s)
 construct new YAPAtom from UTF-8 string More...
 
 YAPAtom (const wchar_t *s)
 construct new YAPAtom from UTF-8 string More...
 
 YAPAtom (const char *s, size_t len)
 construct new YAPAtom from wide string More...
 
const char * getName (void)
 get name of atom More...
 
const char * text (void)
 get name of (other way) More...
 
Prop getProp (PropTag tag)
 get prop of type More...
 
Atom asAtom ()
 as Atom More...
 

Friends

class YAPEngine
 
class YAPModuleProp
 
class YAPPredicate
 
class YAPFunctor
 
class YAPAtomTerm
 
class YAProp
 
class YAPModule
 
class YAPQuery
 

Constructor & Destructor Documentation

◆ YAPAtom() [1/3]

YAPAtom ( const char *  s)
inline

construct new YAPAtom from UTF-8 string

Definition at line 85 of file yapa.hh.

◆ YAPAtom() [2/3]

YAPAtom ( const wchar_t *  s)
inline

construct new YAPAtom from UTF-8 string

Definition at line 87 of file yapa.hh.

◆ YAPAtom() [3/3]

YAPAtom ( const char *  s,
size_t  len 
)
inline

construct new YAPAtom from wide string

construct new YAPAtom from max-length string

Definition at line 91 of file yapa.hh.

Member Function Documentation

◆ asAtom()

Atom asAtom ( )
inline

as Atom

Definition at line 99 of file yapa.hh.

◆ getName()

const char * getName ( void  )

get name of atom

Definition at line 647 of file yapi.cpp.

◆ getProp()

Prop getProp ( PropTag  tag)
inline

get prop of type

Definition at line 97 of file yapa.hh.

◆ text()

const char * text ( void  )
inline

get name of (other way)

Definition at line 95 of file yapa.hh.

Friends And Related Function Documentation

◆ YAPAtomTerm

friend class YAPAtomTerm
friend

Definition at line 76 of file yapa.hh.

◆ YAPEngine

friend class YAPEngine
friend

Definition at line 72 of file yapa.hh.

◆ YAPFunctor

friend class YAPFunctor
friend

Definition at line 75 of file yapa.hh.

◆ YAPModule

friend class YAPModule
friend

Definition at line 78 of file yapa.hh.

◆ YAPModuleProp

friend class YAPModuleProp
friend

Definition at line 73 of file yapa.hh.

◆ YAPPredicate

friend class YAPPredicate
friend

Definition at line 74 of file yapa.hh.

◆ YAPQuery

friend class YAPQuery
friend

Definition at line 79 of file yapa.hh.

◆ YAProp

friend class YAProp
friend

Definition at line 77 of file yapa.hh.

◆ YAPProp

class YAPProp

Prop A YAP Propery is ameta-class for everything one can in a atom.

Examples of properties include functors, predicates, operators, modules, almost everything

Definition at line 109 of file yapa.hh.

Inheritance diagram for YAPProp:
YAPFunctor YAPModuleProp YAPPredicate YAPFLIP YAPPrologPredicate YAPQuery

Public Member Functions

virtual ~YAPProp ()
 get name of property virtual YAPAtom name(); More...
 

Friends

class YAPModuleProp
 
class YAPFunctor
 

Constructor & Destructor Documentation

◆ ~YAPProp()

virtual ~YAPProp ( )
inlinevirtual

get name of property virtual YAPAtom name();

Definition at line 119 of file yapa.hh.

Friends And Related Function Documentation

◆ YAPFunctor

friend class YAPFunctor
friend

Definition at line 111 of file yapa.hh.

◆ YAPModuleProp

friend class YAPModuleProp
friend

Definition at line 110 of file yapa.hh.

◆ YAPFunctor

class YAPFunctor

YAPFunctor represents Prolog functors Name/Arity.

Definition at line 125 of file yapa.hh.

Inheritance diagram for YAPFunctor:
YAPProp

Public Member Functions

 YAPFunctor (YAPAtom at, uintptr_t arity)
 Constructor: receives name as an atom, plus arity. More...
 
 YAPFunctor (const char *s, uintptr_t arity, bool isutf8=true)
 Constructor: receives name as a string plus arity. More...
 
 YAPFunctor (const wchar_t *s, uintptr_t arity)
 Constructor: receives name as a wide string plus arity. More...
 
YAPAtom name ()
 Getter: extract name of functor as an atom. More...
 
arity_t arity ()
 Getter: extract arity of functor as an unsigned integer. More...
 
Functor fun ()
 Getter: extract the C functor. More...
 
- Public Member Functions inherited from YAPProp
virtual ~YAPProp ()
 get name of property virtual YAPAtom name(); More...
 

Friends

class YAPApplTerm
 
class YAPTerm
 
class YAPPredicate
 
class YAPQuery
 

Constructor & Destructor Documentation

◆ YAPFunctor() [1/3]

YAPFunctor ( YAPAtom  at,
uintptr_t  arity 
)
inline

Constructor: receives name as an atom, plus arity.

This is the default method, and the most popular

Definition at line 140 of file yapa.hh.

◆ YAPFunctor() [2/3]

YAPFunctor ( const char *  s,
uintptr_t  arity,
bool  isutf8 = true 
)
inline

Constructor: receives name as a string plus arity.

Notice that this is designed for ISO-LATIN-1 right now Note: Python confuses the 3 constructors, use YAPFunctorFromString

Definition at line 147 of file yapa.hh.

◆ YAPFunctor() [3/3]

YAPFunctor ( const wchar_t *  s,
uintptr_t  arity 
)
inline

Constructor: receives name as a wide string plus arity.

Notice that this is designed for UNICODE right now

Note: Python confuses the 3 constructors, use YAPFunctorFromWideString

Definition at line 156 of file yapa.hh.

Member Function Documentation

◆ arity()

arity_t arity ( )
inline

Getter: extract arity of functor as an unsigned integer.

this is for external usage

Definition at line 167 of file yapa.hh.

◆ fun()

Functor fun ( )
inline

Getter: extract the C functor.

this is for external usage

Definition at line 172 of file yapa.hh.

◆ name()

YAPAtom name ( )
inline

Getter: extract name of functor as an atom.

this is for external usage

Definition at line 162 of file yapa.hh.

Friends And Related Function Documentation

◆ YAPApplTerm

friend class YAPApplTerm
friend

Definition at line 126 of file yapa.hh.

◆ YAPPredicate

friend class YAPPredicate
friend

Definition at line 128 of file yapa.hh.

◆ YAPQuery

friend class YAPQuery
friend

Definition at line 129 of file yapa.hh.

◆ YAPTerm

friend class YAPTerm
friend

Definition at line 127 of file yapa.hh.

Enumeration Type Documentation

◆ PropTag

enum PropTag
Enumerator
PRED_TAG 

predicate

DB_TAG 

db key, may be associated with a functor

FUNCTOR_TAG 

generic functor, may include sub-properties

ARITHMETIC_PROPERTY_TAG 

arithmetic function

TRANSLATION_TAG 

map the atom to an integer

HOLD_TAG 

ensure the atom may not be garbafe colected

MUTEX_TAG 

named mutEX

ARRAY_TAG 

A typed array, may be in-db or in-stack deped.

MODULE_TAG 

module

BLACKBOARD_TAG 

the original SICStus blackboard

VALUE_TAG 

associate an atomic value with the atom

GLOBAL_VAR_TAG 

Demoen's proposal for gkobal variables.

BLOB_TAG 

SWI-STYLE ATOM Extension.

OPERATOR_TAG 

Prolog operator,.

Definition at line 32 of file yapa.hh.

Enumerations

enum  PropTag {
  PRED_TAG = PEProp , DB_TAG = DBProperty , FUNCTOR_TAG = FunctorProperty , ARITHMETIC_PROPERTY_TAG = ExpProperty ,
  TRANSLATION_TAG = TranslationProperty , HOLD_TAG = HoldProperty , MUTEX_TAG = MutexProperty , ARRAY_TAG = ArrayProperty ,
  MODULE_TAG = ModProperty , BLACKBOARD_TAG = BBProperty , VALUE_TAG = ValProperty , GLOBAL_VAR_TAG = GlobalProperty ,
  BLOB_TAG = BlobProperty , OPERATOR_TAG = OpProperty
}