예제 #1
0
파일: structs.py 프로젝트: greenTara/ILED
 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    
예제 #2
0
파일: utils.py 프로젝트: knowlp/ILP-Tools
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}