%edu_type: 0=poodmani 1=termi edu_type(ali,0). edu_type(reza,1). year(ali,4). remain(reza,23). remain(zahra,26). avg(zahra,18). on_condition(maryam,1). avg_total(hosein,11.5). promise(hosein,1).%1=promise 0=not promise %fired(X) unit(X,0):-edu_type(X,0), year(X,N),N>=3.5. unit(X,0):-edu_type(X,1), year(X,N),N>=2.5. unit(X,20):-edu_type(X,0), year(X,N),N<3.5. unit(X,24):-edu_type(X,1), year(X,N),N<2.5, remain(X,M),M=<24. unit(X,24):-edu_type(X,1), year(X,N),N<2.5, remain(X,M),M>24, avg(X,K),K>=17. unit(X,20):-edu_type(X,1), year(X,N),N<2.5, remain(X,M),M>24, avg(X,K),K>=12,K<17. unit(X,14):-edu_type(X,1), year(X,N),N<2.5, remain(X,M),M>24, avg(X,K),K<12, on_condition(X,1). unit(X,0) :-edu_type(X,1), year(X,N),N<2.5, remain(X,M),M>24, avg(X,K),K<12, on_condition(X,2), avg_total(X,I),I<10. unit(X,14):-edu_type(X,1), year(X,N),N<2.5, remain(X,M),M>24, avg(X,K),K<12, on_condition(X,2), avg_total(X,I),I>10, promise(X,1). unit(X,0):- edu_type(X,1), year(X,N),N<2.5, remain(X,M),M>24, avg(X,K),K<12, on_condition(X,2), avg_total(X,I),I>10, promise(X,0). unit(X,0):- edu_type(X,1), year(X,N),N<2.5, remain(X,M),M>24, avg(X,K),K<12, on_condition(X,3).