Implement Logic.table and Logic.gray