14 karma · joined Apr 25, 2015 (11y ago) · 10 submissions
comment 6y ago · link · parent
A → B A
-----------
B
However, modus ponens is just one of the names for this. I could also call it function elimination. I could call it →e. Or I could not bother giving it a name and just say that this is a rule in my logic call it whatever you want in your head if you so desire.Things can get complicated, but they aren't always complicated so naming rules isn't strictly necessary.
comment 6y ago · link · parent
The rules
A B
-----
C
and A B
----- (→c)
C
are logically equivalent, the latter just gives you a name to refer to the rule by.Additionally, I would be careful about correcting others that something is "technically" called something else as programming language researchers often use many names for the same concept.
comment 9y ago · link · parent
Additionally, Pyret's type system internally tracks each of the different constructors as a refinement on the type. With the animal example this would be represented internally as something like
Animal%(is-elephant)
if the type is known to only be an elephant. Though this is not used everywhere it could be right now it is part of the system. This means we have room to do things like if-splitting e.g. if is-elephant(x): ...
would be able to treat x as an Animal%(is-elephant)
in the body rather than just an `Animal`.comment 9y ago · link · parent
I would also like to note that we do also have a new feature where types can be inferred if you provide tests in a "where:" block attached to a function. This infers a function's type solely from the examples of usage provided.
If you have any other questions feel free to ask!
comment 10y ago · link · parent
comment 11y ago · link · parent