This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fixpoint :: Eq a => (a -> a) -> a -> a | |
fixpoint f x | |
| x == fx = fx | |
| otherwise = fixpoint f fx | |
where fx = f x | |
mySqrt :: Double -> Double | |
mySqrt n = fixpoint (\x -> (x + n/x) / 2) 1 | |
main :: IO () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module T13704b1 where | |
main :: IO () | |
main = return () | |
-- wrapped by T13704b2.hs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> [ (a, b, c, d, e, f, g, h) | [a, b, c, d, e, f, g, h] <- permutations [1..8], 10*a+b == 10*c+d + 10*e+f + 10*g+h] | |
[] | |
> [ (a, b, c, d, e, f, g, h) | [a, b, c, d, e, f, g, h] <- permutations [1..8], 10*a+b > 10*c+d + 10*e+f + 10*g+h, c > e, e > g] | |
[(8,4,3,5,2,6,1,7), | |
(8,5,3,4,2,6,1,7), | |
(8,6,3,4,2,5,1,7), | |
(8,6,4,3,2,5,1,7), | |
(8,4,3,6,2,5,1,7), | |
(8,6,4,5,2,3,1,7), | |
(8,5,3,6,2,4,1,7), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE StandaloneDeriving #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Chris: | |
Are there decidable second order models in logic? | |
ChatGPT: | |
In logic, a second-order model is a type of mathematical structure that | |
allows quantification over predicates, in addition to the standard | |
quantification over individuals that is possible in first-order models. | |
Second-order models can be either decidable or undecidable, depending | |
on the specific details of the model in question. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following plot summary was written by ChatGPT, after being asked to adapt Little Red Riding Hood to a cyberpunk setting. Some follow-up discussion helped to clarify some points. | |
----------------------- | |
In a dystopian future where the powerful multinational LupusCorp controls the world and is waging war on freedom, the people of the slums are forced to rely on hacking and do-it-yourself cyber-augmentations to survive. The main character, RedRider, is a young hacker who discovers damning trade secrets about LupusCorp. Her mission is to bring these secrets to the Gran-Tech, a leader of the resistance against LupusCorp who is loved and respected by all for her selfless dedication to freedom. | |
The Gran-Tech refuses to use cybernetics for fear of hacking and surveillance, so RedRider must journey into the dangerous corporate-controlled city to deliver the secrets in person. Along the way, she is pursued by LupusCorp's security force, who will stop at nothing to capture her and the secrets she holds. RedRider |