% ------------------------------------------------------------------------------------------------------
% Demonstrates unitized updates with IDs
% ------------------------------------------------------------------------------------------------------

:-eval(consult('./ContractLog/update.prova')).
:-eval(consult('./ContractLog/utils.prova')).


% update two facts with module id
:-solve(add("module1","a(). b().")). % add two facts
:-solve(remove(module1)). % remove module
:-solve(a()). % query

% integrate external file
:-solve(add("./examples/function_tests/update/update1.prova")). % external update1
%:-solve(remove("./examples/function_tests/update/update1.prova")).
:-solve(c()).



:-eval(add("module2","e(). f().")).
:-solve(f()).



:-solve(remove("./examples/function_tests/update/update1.prova")). % remove
%:-solve(add("./examples/function_tests/update/update1.prova")). % remove
:-solve(d()).



% updates with variables - _X is a place holder for the variable defined in the second term (list)
a(X,Y,Z):-add(id1,"b(_0,_1,_2).",[X,Y,Z]).
:-solve(a(1,"a",2)).
:-solve(b(X,Y,Z)).
