mirror of
https://github.com/Jaxan/nominal-lstar.git
synced 2025-04-27 14:47:45 +02:00
Removed some debug IO
This commit is contained in:
parent
15a02c4762
commit
e475c5b471
2 changed files with 5 additions and 10 deletions
|
@ -37,7 +37,6 @@ mainExample learnerName teacherName autName = do
|
||||||
NomLStar -> learnAngluinRows teacher
|
NomLStar -> learnAngluinRows teacher
|
||||||
NomLStarCol -> learnAngluin teacher
|
NomLStarCol -> learnAngluin teacher
|
||||||
NomNLStar -> learnBollig teacher
|
NomNLStar -> learnBollig teacher
|
||||||
putStrLn "Finished! Final hypothesis ="
|
|
||||||
print h
|
print h
|
||||||
|
|
||||||
mainWithIO :: String -> IO ()
|
mainWithIO :: String -> IO ()
|
||||||
|
@ -46,7 +45,6 @@ mainWithIO learnerName = do
|
||||||
NomLStar -> learnAngluinRows teacherWithIO
|
NomLStar -> learnAngluinRows teacherWithIO
|
||||||
NomLStarCol -> learnAngluin teacherWithIO
|
NomLStarCol -> learnAngluin teacherWithIO
|
||||||
NomNLStar -> learnBollig teacherWithIO
|
NomNLStar -> learnBollig teacherWithIO
|
||||||
putStrLn "Finished! Final hypothesis ="
|
|
||||||
print h
|
print h
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
|
|
@ -246,11 +246,8 @@ ioMembership inputs = unsafePerformIO $ do
|
||||||
loop
|
loop
|
||||||
Just f -> return f
|
Just f -> return f
|
||||||
answer <- runInputT defaultSettings loop
|
answer <- runInputT defaultSettings loop
|
||||||
Prelude.print $ orbit [] (input, fromBool answer)
|
|
||||||
return $ orbit [] (input, fromBool answer)
|
return $ orbit [] (input, fromBool answer)
|
||||||
let answersAsSet = sum . fromList $ answers
|
let answersAsSet = simplify . sum . fromList $ answers
|
||||||
Prelude.putStrLn "\n# Thanks!"
|
|
||||||
Prelude.print answersAsSet
|
|
||||||
return answersAsSet
|
return answersAsSet
|
||||||
|
|
||||||
-- Poses a query to the terminal, waiting for the user to provide a counter example
|
-- Poses a query to the terminal, waiting for the user to provide a counter example
|
||||||
|
@ -260,7 +257,7 @@ ioEquivalent hypothesis = unsafePerformIO $ do
|
||||||
Prelude.putStrLn "\n# Is the following automaton correct?"
|
Prelude.putStrLn "\n# Is the following automaton correct?"
|
||||||
Prelude.putStr "# "
|
Prelude.putStr "# "
|
||||||
Prelude.print hypothesis
|
Prelude.print hypothesis
|
||||||
Prelude.putStrLn "# Nothing for Yes, Just [...] for a counter example"
|
Prelude.putStrLn "# \"Nothing\" for equivalent, \"Just [...]\" for a counter example (eg \"Just [0,1,0]\")"
|
||||||
answer <- runInputT defaultSettings loop
|
answer <- runInputT defaultSettings loop
|
||||||
case answer of
|
case answer of
|
||||||
Nothing -> return Nothing
|
Nothing -> return Nothing
|
||||||
|
@ -278,10 +275,10 @@ ioEquivalent hypothesis = unsafePerformIO $ do
|
||||||
loop = do
|
loop = do
|
||||||
x <- getInputLine "> "
|
x <- getInputLine "> "
|
||||||
case x of
|
case x of
|
||||||
Nothing -> error "Quit"
|
Nothing -> error "Bye bye, have a good day!"
|
||||||
Just str -> do
|
Just str -> do
|
||||||
case readMaybe str :: Maybe (Maybe [Prelude.String]) of
|
case readMaybe str :: Maybe (Maybe [Int]) of
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
outputStrLn $ "Unable to parse " ++ str ++ " :: Maybe [String]"
|
outputStrLn $ "Unable to parse " ++ str ++ " :: Maybe [Int]"
|
||||||
loop
|
loop
|
||||||
Just f -> return f
|
Just f -> return f
|
||||||
|
|
Loading…
Add table
Reference in a new issue