int servlet(int fd){ char greetings[BUFF_SIZE]; sprintf(greetings,"Greetings client #%d\n",fd); write(fd,greetings,strlen(greetings)); firstFunc(fd); char* sorry="Sorry :(\nDid you hear about nginx getting owned in July?"; write(fd,sorry,strlen(sorry)); return 0; }
void visit(const Structure* structure) { Assert(isTheoryOpen()); printTab(); output() << "Data: " << '\n'; indent(); auto voc = structure->vocabulary(); for (auto it = voc->firstSort(); it != voc->lastSort(); ++it) { auto s = it->second; if (not s->builtin()) { printTab(); auto name = s->name(); name = capitalize(name); output() << name << " = "; auto st = structure->inter(s); visit(st); output() << '\n'; } } for (auto it = voc->firstPred(); it != voc->lastPred(); ++it) { auto sp = it->second->nonbuiltins(); for (auto jt = sp.cbegin(); jt != sp.cend(); ++jt) { auto p = *jt; if (p->arity() == 1 && p->sorts()[0]->pred() == p) { // If it is in fact a sort, ignore it continue; } auto pi = structure->inter(p); if (pi->ct()->size() == 0 && pi->cf()->size() == 0) { continue; } if (not pi->approxTwoValued()) { output() << "Partial: " << '\n'; //TEMPORARY GO TO PARTIAL BLOCK } printTab(); auto name = p->nameNoArity(); name = capitalize(name); output() << name << " = "; visit(pi->ct()); if (not pi->approxTwoValued()) { visit(pi->cf()); output() << '\n'; output() << "Data: "; //RETURN TO DATA BLOCK } output() << '\n'; } } for (auto it = voc->firstFunc(); it != voc->lastFunc(); ++it) { auto sf = it->second->nonbuiltins(); for (auto jt = sf.cbegin(); jt != sf.cend(); ++jt) { auto f = *jt; auto fi = structure->inter(f); if (fi->approxTwoValued()) { printTab(); auto name = f->nameNoArity(); name = capitalize(name); output() << name << " = "; auto ft = fi->funcTable(); visit(ft); } else { auto pi = fi->graphInter(); auto ct = pi->ct(); auto cf = pi->cf(); if (ct->approxEmpty() && cf->approxEmpty()) { continue; } output() << "Partial: " << '\n'; //TEMPORARY GO TO PARTIAL BLOCK printTab(); auto name = f->nameNoArity(); name = capitalize(name); output() << name << " = "; printAsFunc(ct); printAsFunc(cf); output() << '\n'; output() << "Data: "; //RETURN TO DATA BLOCK } output() << '\n'; } } unindent(); output() << '\n'; }