2005-06-16 15:10:07 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "term.h"
|
|
|
|
#include "compiler.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Some macros
|
|
|
|
*/
|
|
|
|
#define langhide(x,y) x = levelConst(symbolSysConst(" _" y "_ "))
|
|
|
|
#define langtype(x,y) x->stype = termlistAdd(x->stype,y);
|
|
|
|
#define langcons(x,y,z) x = levelConst(symbolSysConst(y)); langtype(x,z)
|
|
|
|
|
|
|
|
/* externally used:
|
|
|
|
*/
|
|
|
|
|
|
|
|
Term TERM_Agent;
|
|
|
|
Term TERM_Function;
|
|
|
|
Term TERM_Hidden;
|
|
|
|
Term TERM_Type;
|
|
|
|
Term TERM_Nonce;
|
|
|
|
Term TERM_Ticket;
|
2005-11-12 21:13:00 +00:00
|
|
|
Term TERM_Data;
|
2005-06-16 15:10:07 +01:00
|
|
|
|
|
|
|
Term TERM_Claim;
|
|
|
|
Term CLAIM_Secret;
|
|
|
|
Term CLAIM_Nisynch;
|
|
|
|
Term CLAIM_Niagree;
|
|
|
|
Term CLAIM_Empty;
|
2005-12-28 11:50:17 +00:00
|
|
|
Term CLAIM_Reachable;
|
2005-06-16 15:10:07 +01:00
|
|
|
|
|
|
|
//! Init special terms
|
|
|
|
/**
|
|
|
|
* This is called by compilerInit
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
specialTermInit (const System sys)
|
|
|
|
{
|
|
|
|
/* Init system constants */
|
|
|
|
|
|
|
|
langhide (TERM_Type, "Type");
|
|
|
|
langhide (TERM_Hidden, "Hidden");
|
|
|
|
langhide (TERM_Claim, "Claim");
|
|
|
|
|
|
|
|
langcons (TERM_Agent, "Agent", TERM_Type);
|
|
|
|
langcons (TERM_Function, "Function", TERM_Type);
|
|
|
|
langcons (TERM_Nonce, "Nonce", TERM_Type);
|
|
|
|
langcons (TERM_Ticket, "Ticket", TERM_Type);
|
2005-11-12 21:13:00 +00:00
|
|
|
langcons (TERM_Data, "Data", TERM_Type);
|
2005-06-16 15:10:07 +01:00
|
|
|
|
|
|
|
langcons (CLAIM_Secret, "Secret", TERM_Claim);
|
|
|
|
langcons (CLAIM_Nisynch, "Nisynch", TERM_Claim);
|
|
|
|
langcons (CLAIM_Niagree, "Niagree", TERM_Claim);
|
|
|
|
langcons (CLAIM_Empty, "Empty", TERM_Claim);
|
2005-12-28 11:50:17 +00:00
|
|
|
langcons (CLAIM_Reachable, "Reachable", TERM_Claim);
|
2005-06-16 15:10:07 +01:00
|
|
|
}
|