Esempio n. 1
0
// WriteExtendedTrace writes an extended proof trace in TraceCheck format.
// Requires that p was created with EnableTrace.
func (p *Pigosat) WriteExtendedTrace(f io.Writer) error {
	defer p.ready(true)()
	if Status(C.picosat_res(p.p)) != Unsatisfiable {
		return fmt.Errorf("expected to be in Unsatisfiable state")
	}

	return cFileWriterWrapper(f, func(cfile *C.FILE) error {
		// void picosat_write_extended_trace (PicoSAT *, FILE * trace_file);
		_, err := C.picosat_write_extended_trace(p.p, cfile)
		return err
	})
}
Esempio n. 2
0
// Res returns Solve's last status, or Unknown if Solve hasn't yet been called.
func (p *Pigosat) Res() (status Status) {
	defer p.ready(true)()
	// int picosat_res (PicoSAT *);
	return Status(C.picosat_res(p.p))
}