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

  • Home
  • SEARCH
  • 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 3215936
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:14:09+00:00 2026-05-17T15:14:09+00:00

My understanding is that it means that one can potentially write a program to

  • 0

My understanding is that it means that one can potentially write a program to formally prove that a program written in a statically typed language will be free of a certain (small) subset of defects.

My problem with this is as follows:

Assume that we have two turing complete languages, A and B. A is presumed to be ‘type safe’ and ‘B’ is presumed not to be. Suppose I am given a program L to check the correctness of any program written in A. What is to stop me from translating any program written in B to A, applying L. If P translates from A to B then why isn’t PL a valid type checker for any program written in B?

I’m trained in Algebra and am only just starting to study CS so there might be some obvious reason that this doesn’t work but I would very much like to know. This whole ‘type safety’ thing has smelt fishy to me for a while.

  • 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-05-17T15:14:10+00:00Added an answer on May 17, 2026 at 3:14 pm

    Let A be your Turing-complete language which is supposed to be statically typed and let A’ be the language you get from A when you remove the type checking (but not the type annotations because they also serve other purposes). The accepted programs of A will be a subset of the accepted programs of A’. So in particular, A’ will also be Turing-complete.

    Given your translator P from B to A (and vice versa). What is it supposed to do? It could do one of two things:

    1. Firstly, it could translate every program y of B to a program of A. In this case, LPy would always return True as programs of A are by definition correctly typed.

    2. Secondly, P could translate every program y of B to a program of A’. In this case, LPy would return True if Py happens to be a program of A and False if not.

    As the first case doesn’t yield anything interesting, let us stick to the second case, which is probably what you mean. Does the function LP defined on programs of B tell us anything interesting about programs of B? I say no, because it is not invariant under a change of P. As A is Turing-complete, even in the second case P could be chosen so that its image happens to lie in A. Then LP would be constantly True. On the other hand, P could be chosen so that some programs are mapped to the complement of A in A’. In this case LP would spit out False for some (possibly all) programs of B. As you can see, you don’t get anything which only depends on y.

    I can also put it more mathematically in the following way: There is a category C of programming languages whose objects are the programming languages and whose morphisms are translators from one programming language to another one. In particular if there is a morphism P: X -> Y, Y is at least as expressive as X. Between each pair of Turing-complete languages there are morphisms in both directions. For each object X of C (i.e. for each programming language) we have an associated set, say {X} (bad notation, I know) of those partially defined functions that can be computed by programs of X. Each morphism P: X -> Y then induces an inclusion {X} -> {Y} of sets. Let us formally invert all those morphisms P: X -> Y that induce the identity {X} -> {Y}. I will call the resulting category (which is, in mathematical terms, a localization of C) by C’. Now the inclusion A -> A’ is a morphism in C’. However, it is not preserved under automorphisms of A’, that is the morphism A -> A’ is not an invariant of A’ in C’. In other words: from this abstract point of view the attribute “statically typed” is not definable and can be arbitrarily attached to a language.

    To make my point clearer you can also think of C’ as the category of, say, geometrical shapes in three-dimensional space together with the Euclidean motions as morphisms. A’ and B are then two geometrical shapes and P and Q are Euclidean motions bringing B to A’ and vice versa. For example, A’ and B could be two spheres. Now let us fix a point on A’, which shall stand for the subset A of A’. Let us call this point “statically typed”. We want to know whether a point of B is statically typed. So we take such a point y, map it via P to A’ and test, whether it is our marked point on A’. As one can easily see, this depends on the chosen map P or, to put in other words: A marked point on a sphere is not preserved by automorphisms (that are Euclidean motions that map the sphere onto itself) of that sphere.

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

Sidebar

Related Questions

It is my understanding that one can handle events through Swing by adding a
It is my understanding that two unequal objects can have the same hashcode. How
I'm looking to write a tool that aims to convert debug symbols of one
I have a vague understanding of what 'C portability' means (IIRC, it means that
Understanding that I should probably just dig into the source to come up with
It's my understanding that in Spring, all objects are treated by default as singletons.
It's my understanding that all three of these lines below should return an ARRAY
It is my understanding that a texture atlas is basically a single texture that
So it's my understanding that on a ReaderWriterLock (or ReaderWriterLockSlim more specifically), both the
It is my understanding that although Mercurial has support from branches, the community generally

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.