:- discontiguous derived/2.


%% PROBABLY HAVE TO CHANGE SOME OF THESE NOTS TO NEGS FOR CLASSICAL
%% NEGATION

%% true :- unableToBeProductive, hasDistractions,hasOtherCommitments,
%% 	isInPain,hasCrisisHangingOverHead,hasSocialAnxiety,
%% 	lackingSomeUtilties,lacksAmenities,
%% 	isInMaterialWant,lacksProvisions scengendisorderedEnvironment,
%% 	lacksProperWorkEnvironment, lacksProperShelter,
%% 	isPhysicallyUnfitToWork, isEmotionallyUnfitToWork,
%% 	isMentallyUnfitToWork.


%% SEE ALSO: /var/lib/myfrdcsa/codebases/internal/verber/data/worldmodel/templates/flp/productivity.d.verb
%%           /var/lib/myfrdcsa/codebases/internal/verber/data/worldmodel/templates/flp/productivity.p.verb

%% %% probably have to compile these into a PDDL goal formula in DNF or
%% %% CNF in order to avoid limitations to available planners

%% (figure out why I am not more productive, and add to preconditions,
%%  preferences of productivity

%% (I got rested enough and an energy drink and am productive)

unableToBeProductive(Person) :-
	hasDistractions(Person).

%% energyDrinks notNecessarilySugarKind

hasDistractions(Person) :-
	isInPain(Person) ;
	lacksProvisions(Person) ;
	hasCrisisHangingOverHead(Person) ;
	isDreading(Person,_) ;
	has(Person,stressors) ;
	isInMaterialWant(Person) ;
	hasSocialAnxiety(Person) ;
	unableToSleep(Person) ;
	hasInterruptions(Person) ;
	hasOtherCommitments(Person) ;
	recentlyMissedTakingMedications(Person).

%% Target a certain number of days in a row free of distractions.

%% daysUntilExpectedChangeOfState, free from dread of
%% change in situation, or responsibility to plan for
%% changes

%% Right now I am tired from staying up most of the night, and
%% not taking my meds.  Furthermore I can't put my heart into
%% any development effort because I saw Mom's condition didn't
%% look very good today and I'm worried about our future.
%% Also I have guilt because I watched a good bit of
%% Braveheart instead of working on anything, probably cause
%% I'm tired.


hasOtherCommitments(Person) :-
	hasSomethingForToDo(_,Person).

isInPain(Person) :-
	hasPain(Person,_) ;
	hasToothache(Person) ;
	hasBiologicalIssues(Person).

hasCrisisHangingOverHead(Person) :-
	unableToPayUpcomingBills(Person) ;
	hasPain(Person,_).

hasSocialAnxiety(Person) :-
	isMadAt(Person2,Person) ;
	blaming(Person2,Person) ;
	scapegoating(Person2,Person) ;
	hasUpcomingSocietyEvent(Person,_).

lackingSomeUtilties(Environment) :-
	not((
	     hasService(Internet),
	     hasService(Water),
	     hasFacility(Bathroom),
	     hasService(Electricity)
	    )).

lacksAmenities(Environment) :-
	lackingSomeUtilities(Environment) ;
	lacksProvisions(Environment) ;
	not(hasService(Environment,drinkingWater)) ;
	not(hasConvienetAccessToAStore(Environment)) ;
	disorderedEnvironment(Person,Environment).

isInMaterialWant(Person) :-
	not(supplyChainIsSecure(Person)) ;
	(   
	    isInEnvironment(Person,Environment),
	    lacksProvisions(Environment)
	).

lacksProvisions(Environment) :-
	not(hasItemOfType(Environment,water)).

disorderedEnvironment(Person,Environment) :-
	not((
	     furnanceFilterInstalled(Environment),
	     airFilterFiltersInstalled(Environment),
	     supplyChainIsSecure(Person),
	     not((
		  isEssentialPartOfEnvironment(Environment,Object),
		  broken(Object)
		 ))
	    )).

lacksProperWorkEnvironment(Person,Environment) :-
	isInEnvironment(Person,Environment),
	not((
	     not(hasItemOfType(Person,funds)),
	     not(lacksAmenities(Environment)),
	     workSetupAvailable,
	     hasCapability(Person,imakSmartGloves),
	     has(Person,operational(Headset)),
	     isa(Headset,headset),
	     has(Person,operational(Phone)),
	     isa(Phone,phone),
	     hasProperty(phone,on(charger)),
	     computersAreWorking,
	     not(hasCaffeine(Person))
	    )).

lacksProperShelter(Person,Shelter) :-
	lacksAmenities(Shelter).

isPhysicallyUnfitToWork(Person) :-
	(   sick(Person) ;
	    tired(Person) ;
	    disturbedSleepSchedule(Person) ;
	    not(hasProperty(Person,healthy)) ;
	    hasTinglyPuffyLethargicFeelingsInHands(Person)).

isEmotionallyUnfitToWork(Person) :-
	burntOut(Person) ;
	anxious(Person) ;
	depressed(Person) ;
	avolition(Person) ;
	languishing(Person) ;
	lacksFortitude(Person).

isMentallyUnfitToWork(Person) :-
	not(hasClearConceptionOfWhatNeedsToBeDone(Person)) ;
	avolition(Person) ;
	languishing(Person) ;
	not(has(Person,and([geist,motivation]))).


%% forceMultiplier()

%% (figure out why I am not able to read more books
%%  (can't read everything over TTS)
%%  (doesn't do a good job of saving what I have read)
%%  (can't stop easily when I am not paying attention)
%%  (can't multitask)
%%  (can't ?)
%%  (don't have the ability to listen to one computer when switching
%%   between them)

%% Can't have Mom increasing the temperature.
%% Can't have my Monitor stop working.
%% Can't have game shut down.
%% Can't have electric bill so high I don't have the money to pay it.
%% Can't have rent so high I don't have the money to pay it.
%% Can't have medication not working.
%% Can't have people not getting shit done.
%% Can't have distractions.
%% Can't have people not getting back to me.
%% Can't be suicidal.
%% Can't be tingly.
%% Can't be uncomfortable.
%% Can't be thirsty.
%% I can try staying up at night. 


%% For Justin

%% Not hot in his room.
%% Not tired.


%% For Meredith

%% come up with some Christian constraints

%% there were other constraints I am now forgetting


%% increasesChanceOf(willBeProductive(andrewDougherty))
%% 	hasCapability(headset).

%% possible(willBeProductive(andrewDougherty)) :-
%% 	hasEnough(andrewDougherty,food),

