|
-
April 23rd, 2009, 11:54 PM
#1
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
-
April 24th, 2009, 12:02 AM
#2
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.
-
April 24th, 2009, 12:22 AM
#3
Re: Concept, Concept Map, and Axioms
 Originally Posted by Lindley
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
-
April 24th, 2009, 01:02 AM
#4
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
-
April 25th, 2009, 02:52 AM
#5
Re: Concept, Concept Map, and Axioms
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|