Sha256: 49dc218343dd328f2c8408d471e5985ac9eb1be45bca3867e04d00c55a7bb6b8
Contents?: true
Size: 440 Bytes
Versions: 7
Compression:
Stored size: 440 Bytes
Contents
abstar = regular("(a b)*") # The complement of a regular language language L is defined as # the set of strings not belonging to L complement = abstar**-1 # The complement of the complement is the regular language itself compcomp = complement**-1 assert abstar <=> compcomp # Also observe that the complement of a regular language can be # computed explicitly as the otherway = regular("(a | b)*") - abstar assert otherway <=> complement
Version data entries
7 entries across 7 versions & 1 rubygems