Skip to content

Instantly share code, notes, and snippets.

<?xml version='1.0' ?><certificationProblem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="cpf3.xsd"><cpfVersion>3.0</cpfVersion><lookupTables /><input><infeasibilityInput><ctrs><conditionType><oriented /></conditionType><rules><rule><funapp><name>last</name><funapp><name>cons</name><var>x</var><var>y</var></funapp></funapp><var>x</var><conditions><condition><var>y</var><funapp><name>nil</name></funapp></condition></conditions></rule><rule><funapp><name>last</name><funapp><name>cons</name><var>x</var><var>y</var></funapp></funapp><var>z</var><conditions><condition><var>y</var><funapp><name>cons</name><var>u</var><var>v</var></funapp></condition><condition><funapp><name>last</name><var>y</var></funapp><var>z</var></condition></conditions></rule></rules></ctrs><infeasibilityQuery><rule><var>x4</var><funapp><name>nil</name></funapp></rule><rule><var>x4</var><funapp><name>cons</name><var>x1</var><var>x2</var></funapp></rule><rule><funapp><name>last</name><var>x4</var></funapp><va
<?xml version="1.0"?>
<certificationProblem noNamespaceSchemaLocation="cpf3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cpfVersion>3.0</cpfVersion>
<lookupTables/>
<input>
<infeasibilityInput>
<ctrs>
<conditionType>
<oriented/>
</conditionType>
<?xml version="1.0"?>
<certificationProblem noNamespaceSchemaLocation="cpf3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cpfVersion>3.0</cpfVersion>
<lookupTables/>
<input>
<infeasibilityInput>
<ctrs>
<conditionType>
<oriented/>
</conditionType>
<?xml version="1.0"?>
<certificationProblem noNamespaceSchemaLocation="cpf3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cpfVersion>3.0</cpfVersion>
<lookupTables/>
<input>
<infeasibilityInput>
<ctrs>
<conditionType>
<oriented/>
</conditionType>
<?xml version="1.0"?>
<certificationProblem noNamespaceSchemaLocation="cpf3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cpfVersion>3.0</cpfVersion>
<lookupTables/>
<input>
<infeasibilityInput>
<ctrs>
<conditionType>
<oriented/>
</conditionType>
<?xml version='1.0' ?><certificationProblem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="cpf3.xsd"><cpfVersion>3.0</cpfVersion><lookupTables /><input><trsInput><trs><rules><rule><funapp><name>half</name><funapp><name>0</name></funapp></funapp><funapp><name>0</name></funapp></rule><rule><funapp><name>half</name><funapp><name>s</name><funapp><name>0</name></funapp></funapp></funapp><funapp><name>0</name></funapp></rule><rule><funapp><name>half</name><funapp><name>s</name><funapp><name>s</name><var>x</var></funapp></funapp></funapp><funapp><name>s</name><funapp><name>half</name><var>x</var></funapp></funapp></rule><rule><funapp><name>bits</name><funapp><name>0</name></funapp></funapp><funapp><name>0</name></funapp></rule><rule><funapp><name>bits</name><funapp><name>s</name><var>x</var></funapp></funapp><funapp><name>s</name><funapp><name>bits</name><funapp><name>half</name><funapp><name>s</name><var>x</var></funapp></funapp></funapp></funapp></rule></rules></trs></trsInput></i
<?xml version='1.0' ?><certificationProblem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="cpf3.xsd"><cpfVersion>3.0</cpfVersion><lookupTables /><input><trsInput><trs><rules><rule><funapp><name>monus</name><funapp><name>0</name></funapp><var>y</var></funapp><funapp><name>0</name></funapp></rule><rule><funapp><name>monus</name><var>x</var><funapp><name>0</name></funapp></funapp><var>x</var></rule><rule><funapp><name>monus</name><funapp><name>s</name><var>x</var></funapp><funapp><name>s</name><var>y</var></funapp></funapp><funapp><name>monus</name><var>x</var><var>y</var></funapp></rule><rule><funapp><name>div</name><funapp><name>0</name></funapp><funapp><name>s</name><var>y</var></funapp></funapp><funapp><name>0</name></funapp></rule><rule><funapp><name>div</name><funapp><name>s</name><var>x</var></funapp><funapp><name>s</name><var>y</var></funapp></funapp><funapp><name>s</name><funapp><name>div</name><funapp><name>monus</name><var>x</var><var>y</var></funapp><funapp><name>s</
<?xml version='1.0' ?><certificationProblem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="cpf3.xsd"><cpfVersion>3.0</cpfVersion><input><trsInput><trs><rules><rule><funapp><name>f</name><funapp><name>f</name><var>x</var></funapp></funapp><funapp><name>f</name><funapp><name>g</name><funapp><name>f</name><var>x</var></funapp></funapp></funapp></rule></rules></trs></trsInput></input><property><termination /></property><answer><yes /></answer><proof><trsTerminationProof><ruleRemoval><monotonicSemanticPathOrder><generalizedWeightedPathOrder><precedenceList><precedenceListEntry><name>f</name><arity>1</arity><precedence>0</precedence></precedenceListEntry><precedenceListEntry><name>g</name><arity>1</arity><precedence>1</precedence></precedenceListEntry></precedenceList><interpretation><type><polynomial><domain><naturals /></domain><degree>1</degree></polynomial></type><interpret><name>f</name><arity>1</arity><sum><product><integer>1</integer><variable>1</variable></product><integer>
import Data.List
type Natural = Integer -- the natural numbers
-- must be manipulated via the smart constructor `ordinal`
-- to ensure Cantor normal forms.
data Ordinal = Zero | Omega [Ordinal]
deriving Eq
instance Show Ordinal where
import qualified Data.ByteString.Builder as BSB
import System.IO
-- https://hackage.haskell.org/package/bytestring-0.11.4.0/docs/Data-ByteString-Builder.html#g:12
main :: IO ()
main = BSB.hPutBuilder stdout (mconcat [BSB.string7 "I'm ", BSB.intDec 7, BSB.string7 " years old now.\n"])