Ejemplo n.º 1
0
 def get_terms_types_map(self,lit):
     _map = {}
     mode = self.subsuming_mode 
     for s in ['+','-','#']:
         terms = functs.plm_pattern(mode,s)
         d = self.get_maps(lit,terms,s)
         _map.update(d)
     return _map    
Ejemplo n.º 2
0
def get_head_in_terms(atom):
    modes = gl.modeh
    out = []
    for m in modes:
        out.extend(functs.plm_pattern(m, '+'))
    with open(gl.ground,'w') as f:
        f.write('%s.\n\n'%(atom))
        f.write(''.join(map(lambda (x,y): '{term(X,%s):%s}.\n'%(y,x),out)))
        f.write('#hide.\n')
        f.write('#show term/2.\n')
    f.close()   
    out = asp.ground()     
    k = [functs.determ(x) for x in out]    
    return {x[0]:x[1] for x in k}