diff --git a/todo.pl b/todo.pl index d7f82d4..c1028ab 100644 --- a/todo.pl +++ b/todo.pl @@ -47,6 +47,17 @@ new(X,Y) :- write(X), write(" as a subtask for "), write(X). + +delete(X):- idx(X,Y), delete(Y). +delete(X):- + retractall(task(X,_)), + retractall(requires(X,_)), + retractall(requires(_,X)). +delete(X,Y):- idx(X,T), delete(T,Y). +delete(X,Y):- idx(Y,T), delete(X,T). +delete(X,Y):- retractall(requires(X,Y)). + + depend(X,Y) :- idx(X, Task), depend(Task, Y). depend(X,Y) :- idx(Y, Task), depend(X, Task). depend(X,Y) :-