shithub: pprolog

ref: 8fde6e4845eeafe6ffc4179218a3ac9e8049c0e6
dir: /dat.h/

View raw version
typedef struct Term Term;
typedef struct Binding Binding;

struct Term
{
	int tag;

	Rune *text;
	int arity;
	Term *next;
	Term *children;
	int numbertype;
	vlong ival;
	double dval;
	uvlong clausenr;
};

struct Binding
{
	Rune *name;
	uvlong nr; /* Unique number for each clause. Every time a clause is used, it gets a new number. */
	Term *value;
	Binding *next;
};

enum {
	CompoundTerm,
	AtomTerm,
	VariableTerm,
	NumberTerm,
	StringTerm,
};

enum {
	NumberInt,
	NumberFloat,
};

int debug;
Term *initgoals;