I’m using: SWI-Prolog version 8.0.3
I want the code to:
i have a lot of records like this: place(_ ,_ ,_ ,_ ,FT,_) in a script called nodes.pl, everyone in a different row… and i want to tell from another script: "if FT in place is > X then delete the entire row…
i want this function in the main script, but the “place-like” records are in another script called nodes.pl
The purpose is to delete from the nodes.pl database the people who have been in a place (whatever the place is) more then 30 days ago.
I have to do this operation at the starting of the program… so i can work only with “new” records…
i know there could be a lot of errors but i’m at my beginning with prolog and this is for a univ project and i don’t know how to figure this problem out…
i don’t think it is rocket science but i’m not so skilled so far
thanks a lot for your help!
PS. i want to iterate the function for every row in the file so i can work only with the recent people at every start.
My code looks like this:
%main.pl %example of place element %place("Eva", 1487273300000, 0, 0, 1594380400000, "Paris"). %place("Mark", 1575373400000, 0, 0, 1667383500000, "NY"). %place("Linda", 1511373700000, 0, 0, 1888380200000, "Rome"). %..... delete_from_nodes(place):- %place is in the nodes.pl script get_time(Curr), Limit is (Curr-2592000)*1000, %30 days FT>Limit, %FT is an element of place, that is in nodes.pl script retract(place(_,_,_,_,FT,_)).