% $Id: visible_signature.mod,v 1.1 1994/04/27 15:23:27 leavens Exp leavens $
%
% Signature of the built-in (visible) types in mini Cecil.
%
% AUTHOR: Gary T. Leavens

module visible_signature.

import signature mini_cecil_abstract_syntax.

% names of the visible types
type boolName typeExpr -> o.
type voidName typeExpr -> o.
type intName typeExpr -> o.

% types of variables
type varType typeExpr -> typeExpr.

boolName (ty "Bool").
intName (ty "Int").
voidName (ty "Void").


% Signature for the built-in types Bool, Int, and Void.
type builtInSignature	(sig typeExpr) -> o.
builtInSignature S :-
	boolName BoolName,
	intName IntName,
	voidName VoidName,
	S = 
	(add_message "theVoid" nil VoidName
	(add_message "true" nil BoolName
	(add_message "false" nil BoolName
	(add_message "and" (BoolName::BoolName::nil) BoolName
	(add_message "or" (BoolName::BoolName::nil) BoolName
	(add_message "not" (BoolName::nil) BoolName
	(add_message "0" nil IntName
	(add_message "1" nil IntName
	(add_message "add" (IntName::IntName::nil) IntName
	(add_message "mult" (IntName::IntName::nil) IntName
	(add_message "negate" (IntName::nil) IntName
	(add_message "equal" (IntName::IntName::nil) BoolName
	(add_type BoolName
	(add_type IntName
	(add_type VoidName
	empty_signature
	))))))))))))))) .
