CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Location
    Salt Lake City, Utah
    Posts
    82

    Concept, Concept Map, and Axioms

    So, I'm going over the C++0x draft, and I get to concepts. I'm understanding it up to where it starts getting into concept maps.
    What is the purpose exactly of a concept map as opposed to a concept?
    When 'typedef' and 'typename' are used in concepts and concept maps, what do they mean?
    When would you use a type other than 'auto' for a concept?
    What is an axiom? (this part was totally confusing to me)
    Intel Core Duo Macbook w/ Mac OS 10.5.6
    gcc 4.2.1 (i386-apple-darwin9.1.0) and Xcode 3.1.1

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Concept, Concept Map, and Axioms

    Axioms are basically ways of telling the compiler explicitly that certain transformations are valid on a given class of expression. This might in theory allow it to make better optimization decisions. For the most part it's not likely to be something programmers worry about directly.

    For instance, if a given class should have commutative multiplication properties, you could specify an axiom that A * B == B * A.

  3. #3
    Join Date
    Jan 2009
    Location
    Salt Lake City, Utah
    Posts
    82

    Re: Concept, Concept Map, and Axioms

    Quote Originally Posted by Lindley View Post
    Axioms are basically ways of telling the compiler explicitly that certain transformations are valid on a given class of expression. This might in theory allow it to make better optimization decisions. For the most part it's not likely to be something programmers worry about directly.

    For instance, if a given class should have commutative multiplication properties, you could specify an axiom that A * B == B * A.
    Is this restricting in that this must be true for a type in order to be used in the template, or is it the developer's responsibility to make sure it's true in all cases?
    Intel Core Duo Macbook w/ Mac OS 10.5.6
    gcc 4.2.1 (i386-apple-darwin9.1.0) and Xcode 3.1.1

  4. #4
    Join Date
    Jan 2009
    Location
    Salt Lake City, Utah
    Posts
    82

    Re: Concept, Concept Map, and Axioms

    For example, if I were to define an axiom as follows:
    Code:
    axiom Associativity(Op op, T x, T y, T z)
    {
        op(x, op(y, z)) == op(op(x, y), z);
    }
    Will the compiler actually confirm that this is true and enforce it, or is it trusted that, since I defined it, it must be true in all cases for that concept, just because I said so?
    Intel Core Duo Macbook w/ Mac OS 10.5.6
    gcc 4.2.1 (i386-apple-darwin9.1.0) and Xcode 3.1.1

  5. #5
    Join Date
    Jan 2009
    Location
    Salt Lake City, Utah
    Posts
    82

    Re: Concept, Concept Map, and Axioms

    Anyone?
    Intel Core Duo Macbook w/ Mac OS 10.5.6
    gcc 4.2.1 (i386-apple-darwin9.1.0) and Xcode 3.1.1

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured