:- dynamic ct/3. :- multifile ct/3. ct( addNode(_v,_t), ( % addNode = extension not(graph_node(_v,_))),( add(graph_node(_v,_t)) )). ct( delNode(_v,_t), ( % delNode = cancellation graph_node(_v,_t), not(graph_edge(_,_v,_,_)), not(graph_edge(_,_,_v,_)) ),( delete(graph_node(_v,_t)) )). ct( addEdge(_e,_v,_w,_t), ( % addEdge = refinement graph_node(_v,_), graph_node(_w,_), not(graph_edge(_e, _v, _w, _)) ),( add(graph_edge(_e, _v, _w, _t)))). ct( delEdge(_e, _v, _w, _t), ( % delEdge = coarsening graph_edge(_e, _v, _w, _t)),( delete(graph_edge(_e, _v, _w, _t)))). ct( retNode(_v, _t, _a), ( % retNode = abstract_noderetyping graph_node(_v,_t)),( replace(graph_node(_v,_t),graph_node(_v,_a)))). ct( retEdge(_e, _v, _w, _t, _a), ( % retEdge = abstract_edgeretyping graph_edge(_e, _v, _w, _t) ),( replace(graph_edge(_e, _v, _w, _t), graph_edge(_e, _v, _w, _a)))). ct( renameNode(_v, _t, _v1), ( graph_node(_v,_t), not(graph_node(_v1,_)) % Integrity constraint ),( replace(graph_node(_v,_t),graph_node(_v1,_t)) ) ). ct( renameEdge(_e, _v, _w, _t, _e1), ( graph_edge(_e, _v, _w, _t), not(graph_edge(_e1, _, _, _)) % Integrity constraint ),( replace(graph_edge(_e, _v, _w, _t), graph_edge(_e1, _v, _w, _t)))).