1:- module(bc_role, [
2 bc_register_role/3,
3 bc_unregister_role/1,
4 bc_role/3
5]). 6
7:- use_module(library(debug)). 8:- use_module(library(error)). 9
10:- dynamic(role/3).
16bc_role(Name, Label, Login):-
17 role(Name, Label, Login).
23bc_register_role(Name, Label, Login):-
24 must_be(atom, Name),
25 must_be(atom, Label),
26 must_be(boolean, Login),
27 ( role(Name, _, _)
28 -> retractall(role(Name, _, _))
29 ; true),
30 assertz(role(Name, Label, Login)),
31 debug(bc_role, 'type ~w registered', [Name]).
38bc_unregister_role(Name):-
39 must_be(atom, Name),
40 retractall(role(Name, _, _))