Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8606061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:00:20+00:00 2026-06-12T03:00:20+00:00

Agda manual on Inductive Data Types and Pattern Matching states: To ensure normalisation, inductive

  • 0

Agda manual on Inductive Data Types and Pattern Matching states:

To ensure normalisation, inductive occurrences must appear in strictly positive positions. For instance, the following datatype is not allowed:

data Bad : Set where
  bad : (Bad → Bad) → Bad

since there is a negative occurrence of Bad in the argument to the constructor.

Why is this requirement necessary for inductive data types?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:00:22+00:00Added an answer on June 12, 2026 at 3:00 am

    The data type you gave is special in that it is an embedding of the untyped lambda calculus.

    data Bad : Set where
      bad : (Bad → Bad) → Bad
    
    unbad : Bad → (Bad → Bad)
    unbad (bad f) = f
    

    Let’s see how. Recall, the untyped lambda calculus has these terms:

     e := x | \x. e | e e'
    

    We can define a translation [[e]] from untyped lambda calculus terms to Agda terms of type Bad (though not in Agda):

    [[x]]     = x
    [[\x. e]] = bad (\x -> [[e]])
    [[e e']]  = unbad [[e]] [[e']]
    

    Now you can use your favorite non-terminating untyped lambda term to produce a non-terminating term of type Bad. For example, we could translate (\x. x x) (\x. x x) to the non-terminating expression of type Bad below:

    unbad (bad (\x -> unbad x x)) (bad (\x -> unbad x x))
    

    Although the type happened to be a particularly convenient form for this argument, it can be generalized with a bit of work to any data type with negative occurrences of recursion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Agda. I'm reading the paper Dependent Types at Work by
I'm trying to encode some denotational semantics into Agda based on a program I
I'm just reading Dependent Types at Work . In the introduction to parametrised types,
I'm trying to prove a simple lemma in Agda, which I think is true.
I have found that I really like combining GADTs with Data Kinds, as it
In Agda, the type of a forall is determined in such a way that
I am trying to parse a string with natural numbers in Agda. e.g., the
I recently completed a university course which featured Haskell and Agda (a dependent typed
I have found a lot of useful information on using Agda as a proof
This is an extension of the question posted here: Agda and Binary Search Trees

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.