On Monday 20 October 2008 15:02:08 Thomas Lord wrote:
> Ugh. High school math tends to be not so very good, afaict.
>
> If they're going to really get into the whys and wherefores of
> Scheme a good place to start, probably absent or poorly done, from their
> high school curriculum is a review of logic, introduction to set
> theory, the concept of a class vs. a set, standard definitions for
> relation, partial order, equivalence, mapping, family, list, and lattice.
> Ideally by the time you're talking about lists and lattices they should
> be doing
> inductive proofs that will make it easier to "see and feel" why
> when you lift a binary relation to make a pairwise predicate that
> applies to sequences it is handy to define the 0-length and singleton
> sequence cases in the obvious way.
Comparison is taught in kindergarden. Comparison is fundamental.
In 40 years of software development I have never seen a sequence outside the
classroom. I write code which compares quantities all the time.
Given multiple models, isn't it more natural to define something more abstract
(e.g. num-seq, see below) which models the properties you want rather than
trying to overgeneralize comparison predicates?
On Monday 20 October 2008 13:24:35 Bradley Lucier wrote:
> In mathematics, statements about the (nonexistent) elements of the
> empty set are taken to be true; such statements are called "vacuously
> true".
[I guess you could label proofs which use such properties "vacuous". ;^]
I find it natural that
0 + x = x
1 * x = 1
(and) => #t
(or) => #f
I find it easy to explain that
(<= low x high)
is a more elegant way to write
((low <= x) && (x <= high))
But
(and (char<? #\z) (=) (string>?)) => #t
(and (< 2) (= 2) (> 2)) => #t
(and (<) (=) (>)) => #t
???
Because
() is monotonically decreasing and
() is monotonically increasing and
() is a desert topping and a floor wax
() is the pope
(2) is monotonically decreasing and
(2) is monotonically increasing
???
Doesn't it make more sense to require existence for comparison?
(define (monotonic? ordered? sequence)
(let ( [list-of-pairs (pairs-in sequence)] )
(if (null? list-of-pairs)
#f
(for-all
(lambda (pair) (ordered? (car pair) (cdr pair)))
list-of-pairs))
) )
Can't we just use comparison predicates to compare quantities?
Is there really a natural, universal, fundamental extension here that needs to
be in the language?
Cheers,
-KenD
;;====================
#!r6rs
(library (theory A num-seq)
(export num-seq? num-seq<) ;;; ...
(import (rnrs))
(define (num-seq? list-of-numbers)
(for-all number? list-of-numbers))
(define num-seq<
(case-lambda
[() #t]
[(single-elt) #t]
[(elt1 elt2) (< elt1 elt2)]
[list-of-numbers
(apply < list-of-numbers)]
) )
;;; ...
)
;; --- E O F --- ;;
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss