1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 15x 15x 15x 15x 15x 233x 233x 233x | import isProblem from "./isProblem"; import isPred from "./isPred"; import isClause from "./isClause"; import conform from "./conform"; export default function isValid( expr, x ) { if ( !expr ) { Ithrow new Error( 'Clause is required' ); } else if ( isClause( expr ) ) { return !( isProblem( conform( expr, x ) ) ); } else Eif ( isPred( expr ) ) { return expr( x ); } else { return true; } } |