2.7 logic-utils
(require sicm/general/logic-utils) | package: rktsicm |
Helper for raising test failures. Shorthand for
Check if val is #t or #f respectively.
Check if at least one item of lst or of val is #t
Check if all items of lst or of val are #t
procedure
(conjunction pred1? pred2?) → predicate/c
pred1? : predicate/c pred2? : predicate/c
Creates a new predicate equal to:
procedure
(disjunction pred1? pred2?) → predicate/c
pred1? : predicate/c pred2? : predicate/c
Creates a new predicate equal to:
procedure
(implication pred1? pred2?) → predicate/c
pred1? : predicate/c pred2? : predicate/c
Creates a new predicate equal to:
procedure
(negation pred?) → predicate/c
pred? : predicate/c
Creates a new predicate equal to:
procedure
(assume! assumption responsible [if-false])
→ (or/c 'OK 'noted any/c) assumption : any/c responsible : any/c if-false : (-> any/c) = take-note!
If assumption is an expression, and all the operands are number?s, try to evaluate it using the procedure? bound to the operator in scmutils-base-environment. If the assumption is #t, return 'OK. If it is false, evaluate if-false. The default is to add a note about the 'false! assumption, returning 'noted.
In all other cases that the assumption was not tested, a note is added to *notes*, with extra info about the responsible rule as an eq-property and the result of the call is 'noted.