def test_from_prefix_all_operators(debug=False): for prefix in ['T', 'F', 'p', '~p', '&pq', '|pq', '->pq', '<->pq', '-&pq', '-|pq', '?:pqr', '?:FFF', '->TT', '->~->xyz', '~?:TTT', '?:<->xxxx', '?:F-&y123F-|y123F']: if debug: print("Testing prefix parsing of formula", prefix) assert Formula.from_prefix(prefix).prefix() == prefix
def test_from_prefix(debug=False): for prefix in ['p', '~x12', '&xy', '~~|x~T', '|&x1~x2F']: if debug: print("Testing prefix parsing of formula", prefix) assert Formula.from_prefix(prefix).prefix() == prefix
def test_from_prefix_all_operators(debug=False): for prefix in ['->~->xyz', '~?:TTT', '?:<->xxxx', '?:F-&y123F-|y123F']: if debug: print("Testing prefix parsing of formula", prefix) x = Formula.from_prefix(prefix).prefix() assert x == prefix