File: context-py.lp

package info (click to toggle)
gringo 4.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,260 kB
  • ctags: 10,755
  • sloc: cpp: 55,049; python: 629; yacc: 569; sh: 124; makefile: 23
file content (21 lines) | stat: -rw-r--r-- 375 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#script (python) 

class State:
    def __init__(self, value):
        self.value = value

    def test(self, value):
        return self.value + value
    
    def __on_model(self, m):
        print (m)

    def run(self, prg):
        prg.ground([("base", [])], self)
        prg.solve(None, self.__on_model)
        
def main(prg):
    x = State(21)
    x.run(prg)

#end.