for example in my program I have the following structure:
Code: Select all
class backend
open resourceIdentifiers
domains
file = input; output; specials_file; scr;
keyboard();%standard functor
screen(); %standard functor
stdin(); %standard functor
stdout(); %standard functor
stderr(). %standard functor
hdlform = string.
tool = string.
local_object = (string,
integer,
string,
string,
integer,
string,
string,
integer,
value).
...
predicates
...
append_local : (local_list, local_object, local_list) % i, i, o
determ (i,i,o) nondeterm(i,i,i).
...
end class backend
Code: Select all
implement backend
class facts - backend_dbase
local_object : (string,
% module name
integer,
% object's order number in DATA_TABLE, or special data list
string,
% local_kind ...: signal, variable, constant, par_in, par_out, par_inout
string,
% object's name
integer,
% order number in the tables (0 if none)
string,
% local_type: object's type
string,
% type_kind: standard library, or user-defined
% array or user-defined record
integer,
% object's size in bits
value).
local_list : backend::local_object*.
...
clauses
...
add_local(In_llist, Local_object, Out_llist) :-
Local_object = local_object(_,_,_,Name,_,_,_,_,_),
not(name_member_local(Name, In_llist)),
append_local(In_llist, Local_object, Out_llist), !.
...
<and some other predicates that use local_object>
with the above structure I get errors like:
Type Action Description Filename Path
e504 The expression has type 'backend::backend_dbase', which is incompatible with the type '(::string, ::integer, ::string, ::string, ::integer, ::string, ::string, ::integer, backend::value) procedure' backend.pack
--------------------------------------------------------------------------
what I am doing wrong?
I declare the types (domains) then the predicates that use them
and then in the implementation (as vp8 recommends) the facts database and
the predicate clauses.
What is wrong with that?
How else can I declare the facts' domains and later the facts to be loaded from external
database file?
Michael Dossis