Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | nub (map fst (parse s)) /= map fst (parse s) = error "Output wire defined more than once" -- Placeholder (stub) until you do your own
- | otherwise = parse s
- --Takes in a list of strings which contains everything on the left side
- --and a circuit, which has already been parsed
- classify :: [String] -> Circuit -> Circuit
- classify [] []
- = []
- classify x (y1,(NOT (w z))):ys
- --z isnt on the left, therefore an input
- | z `notElem` x = (y1,(NOT (IN z))):(classify x ys)
- --z is an output wire
- | z `elem` x = (y1,(NOT (OUT z))):(classify x ys)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement