Esempio n. 1
0
 def get_maps(self,atom,search_patterns,sign):
     #out = []
     with open(self.globvals.ground,'w') as f:
         f.write('%s.\n\n'%(atom))
         f.write(''.join(map(lambda (x,y): '{term(X,%s):%s}.\n'%(y,x),search_patterns)))
         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]:sign+x[1] for x in k}
Esempio 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}