The best way to do this is with a python script. (cf. latest quanto build on "integration" branch).
I haven't written python hooks for calling custom simprocs yet,
but this is on my TODO list.
On the other hand, n
aiive simplication (i.e. apply a list of rules until you can't) is supported.
Here's an example showing various hooks
in action
. Note that, like simprocs, paths are relative to the root of the current project, and file extensions are omitted:
from quanto.util.Scripting import *
enc = load_graph('11-3/encoder')
rules = map(load_rule, [
'pushers/gg', 'pushers/rr',
'pushers/rgd', 'pushers/grd',
'pushers/ggd', 'pushers/rrd',
'pushers/ggu', 'pushers/rru'])
zinputs = ['b0', 'b3', 'b6', 'b7']
xinputs = ['b1', 'b5', 'b8', 'b9']
x = load_graph('pushers/X')
z = load_graph('pushers/Z')
for inp in zinputs:
g = plug(enc, z, inp, 'b1')
d = derivation(g)
d.normalise(rules)
d.save('11-3/stab/stab-Z-' + inp)
for inp in xinputs:
g = plug(enc, x, inp, 'b1')
d = derivation(g)
d.normalise(rules)
d.save('11-3/stab/stab-X-' + inp)