Index: libabac/abac_pl_yy.c
===================================================================
--- libabac/abac_pl_yy.c	(revision de22a7ef0f26390d5a7d03e73c73b8d9a434968b)
+++ libabac/abac_pl_yy.c	(revision 7b548fab06dcb3b91e754d2e22872eb175b6cce4)
@@ -15,4 +15,5 @@
 /* from abac_pl_gen.c */
 extern char *generate_pl_range_constraint(char *,char *,char *,char *);
+extern char *generate_pl_range_time_constraint(char *,char *,char *);
 extern char *generate_pl_oset_constraint_clause(abac_oset_t *, char *);
 extern abac_list_t *generate_pl_role_clauses(abac_role_t *, abac_role_t *);
@@ -21,5 +22,5 @@
 extern char *generate_pl_type_clause(char *, int);
 /* from abac_pl_yap.c */
-extern char *abac_pl_add_string_range_constraint_clause(char *var, 
+extern char *abac_pl_add_range_constraint_clause(char *var, 
 	char *tmplist);
 /* from rt2.y */
@@ -467,4 +468,11 @@
     if(ptr->type==abac_term_verify_term_type("integer") ||
           ptr->type==abac_term_verify_term_type("float"))
+        return 1;
+    return 0;
+}
+
+int is_yy_term_data_type_time(abac_yy_term_data_t *ptr)
+{
+    if(ptr->type==abac_term_verify_term_type("time"))
         return 1;
     return 0;
@@ -1348,8 +1356,8 @@
            switch(type) {
              case e_yy_RANGE_MIN:
-               tmp=generate_pl_range_constraint(typestr,var,val,">");
+               tmp=generate_pl_range_constraint(typestr,var,val,">=");
                break;
              case e_yy_RANGE_MAX:
-               tmp=generate_pl_range_constraint(typestr,var,val,"<");
+               tmp=generate_pl_range_constraint(typestr,var,val,"=<");
                break;
              case e_yy_RANGE_TARGET:
@@ -1371,4 +1379,63 @@
        asprintf(&tmplist,"(%s)",tmplist);
        abac_yy_add_yy_constraints(tmplist);
+   }
+}
+
+/****************************************************************/
+/* this is for time only */
+void make_yy_range_time_constraint(abac_yy_term_data_t *ptr, char *var)
+{
+   char *typestr=abac_term_type(ptr->type);
+   abac_list_t *rlist=get_yy_term_data_cond_range(ptr);
+   char *tmplist=NULL;
+   char *tmp=NULL;
+   char *ttmp=NULL;
+   char *tlist=NULL;
+   int as_range=1; /* either , or ; */
+   if(rlist) {
+       char *rstring=_string_yy_cond_range(rlist);
+       set_yy_term_data_cond_str(ptr,rstring);
+       abac_yy_range_t *cur;
+     
+       /* a list of values -- in chars */
+       abac_list_foreach(rlist, cur,
+           int type=cur->type;
+           char *tval=cur->val; 
+           char *val=abac_term_to_time(tval);
+           switch(type) {
+             case e_yy_RANGE_MIN:
+               ttmp=generate_pl_range_time_constraint(var,val,">");
+               tmp=generate_pl_range_time_constraint(var,val,"=");
+               asprintf(&tlist,"(%s;%s)",ttmp,tmp);
+               tmp=tlist;
+               break;
+             case e_yy_RANGE_MAX:
+               ttmp=generate_pl_range_time_constraint(var,val,"=");
+               tmp=generate_pl_range_time_constraint(var,val,"<");
+               asprintf(&tlist,"(%s;%s)",ttmp,tmp);
+               tmp=tlist;
+               break;
+             case e_yy_RANGE_TARGET:
+               tmp=generate_pl_range_time_constraint(var,val,"=");
+               as_range=0;
+               break;
+           }
+           free(val);
+           /* ; is prolog's disjunction built in predicate */
+           if(tmplist) {
+               if(as_range)
+                   asprintf(&tmplist,"%s,%s",tmplist,tmp);
+                   else
+                       asprintf(&tmplist,"%s;%s",tmplist,tmp);
+               } else {
+                   tmplist=tmp;
+           }
+           tmp=NULL;
+       );
+
+       asprintf(&tmplist,"(%s)",tmplist);
+       /* generate a clause with above and add into db */
+       tmp=abac_pl_add_range_constraint_clause(var,tmplist);
+       abac_yy_add_yy_constraints(tmp);
    }
 }
@@ -1411,5 +1478,5 @@
        asprintf(&tmplist,"(%s)",tmplist);
        /* generate a clause with above and add into db */
-       tmp=abac_pl_add_string_range_constraint_clause(var,tmplist);
+       tmp=abac_pl_add_range_constraint_clause(var,tmplist);
        abac_yy_add_yy_constraints(tmp);
    }
@@ -1422,10 +1489,7 @@
         } else if (is_yy_term_data_type_alpha(ptr)) {
             make_yy_range_string_constraint(ptr, var);
+            } else if (is_yy_term_data_type_time(ptr)) {
+                make_yy_range_time_constraint(ptr, var);
     }
-/*
-        } else if (is_yy_term_data_type_time(ptr)) {
-            make_yy_range_time_constraint(ptr, var);
-    }
-*/
 }
 
