void initialize_contradiction_tactic() { register_tac(name{"tactic", "contradiction"}, [](type_checker &, elaborate_fn const &, expr const &, pos_info_provider const *) { list<name> empty; return then(orelse(intros_tactic(empty), id_tactic()), contradiction_tactic()); }); }
// Set *value to the value of the cell at (r,c), unless there's an // error; in which case return either the error's plaint or // derived_plaint -- the latter to keep from propagating a plaint // between cells -- we want to propagate only the fact of the error, // not the plaint itself. static const char *get_value (Value *value, unsigned r, unsigned c, const char *derived_plaint) { if (rows <= r || cols <= c) return "Cell out of range"; Cell *cell = &cells[r][c]; if (cell->plaint == unknown) update (r, c); if (cell->plaint == calculating) return calculating; if (cell->plaint) return orelse (derived_plaint, cell->plaint); *value = cell->value; return NULL; }
SET_MSG (Msg_Text, Msg_Temp, ")"); fatal(4012); /* missing right paren */ } return(val); } /************************************************************************/ /* constexpr ::= orelse [ '?' orelse ':' orelse ]; */ /************************************************************************/ long constexpr(void) { REG long val; REG long val1; long val2; val = orelse(); if( nextis(L_QUEST) ) { val1 = orelse(); if( nextis(L_COLON) ) val2 = orelse(); return(val ? val1 : val2); } return(val); } /************************************************************************/ /* orelse ::= andif [ '||' andif ]* ; */ /************************************************************************/ long orelse(void) {