File: load-lua.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 (16 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#script(lua)

function main(prg)
    print(string.format("#const y=%s", tostring(prg:get_const("y"))))
    prg:load("program.lp")
    print(string.format("#const y=%s", tostring(prg:get_const("y"))))
    print(string.format("#const x=%s", tostring(prg:get_const("x"))))
    prg:add("base", {}, "#const x=10. b.")
    print(string.format("#const x=%s", tostring(prg:get_const("x"))))
    prg:ground({{"base", {}}})
    prg:solve()
end

#end.

c.