Comments (5)
-|
looks ok. It could be convenient in certain cases. OTOH, if we have multiple type traits (e.g. determinism, totality, etc.), then it might be less convenient. However, we can always make -|
just a syntactic sugar...
from hyperon-experimental.
Term equality in pure MeTTa
It's awesome that term equality can be implemented in pure MeTTa, but how does it work? Why the following reduction path
(eq a a) -> (eq-wrap (pure-eq a a)) -> False
using the fourth then third equation, is inhibited?
Type annotation to indicate determinism
I like the idea of enforcing determinism in the type. I was wondering, as an alternative to Det
, maybe to use a different application type constructor. For instance to indicate that foo
is non-deterministic one could write
(: foo (-| $a $a Bool))
That is ->
would still indicate deterministism, symbolizing that every input points to a single value, while -|
would be used to indicate non-deterministism, symbolizing that some input may point to many values. Then it brings some concerns such as what to do when combining ->
and -|
like in
(: foo (-| $a (-> $a Bool))
etc. So not saying it is better than Det
, but just a suggestion that crossed my mind. Maybe existing non-deterministic functional programming languages such as https://curry.pages.ps.informatik.uni-kiel.de/curry-lang.org/ could be a source of inspiration. I know nothing of such language so I cannot tell.
from hyperon-experimental.
Why the following reduction path
(eq a a) -> (eq-wrap (pure-eq a a)) -> False
using the fourth then third equation, is inhibited?
@ngeiswei the reason is that (pure-eq a a)
is reduced to True
before trying to reduce (eq-wrap (pure-eq a a))
. From non-deterministic execution perspective this is not quite correct because interpreter should execute both paths. But this behavior is saved from the very first version and it allows doing tricks like above before this issue is resolved correctly.
from hyperon-experimental.
Using -|
to designate non-deterministic paths sounds like an interesting idea. I don't even see any contradiction in constructions like (: foo (-| $a (-> $a Bool))
. It can be interpreted as foo
is a function which non-deterministically returns deterministic function (-> $a Bool)
.
It seems that type annotations are also required and using them to designate determinism or non-determinism can be even more simple from the code complexity perspective.
from hyperon-experimental.
From non-deterministic execution perspective this is not quite correct because interpreter should execute both paths.
Well, yes, this is an interesting point. I wonder whether this should be considered a bug or a feature :)
We can describe this as an intended behavior if we wish, but if some examples appear, in which it will be highly desirable to have "full non-determinism", then we can reconsider this. In any case, we shouldn't rely too much on this "feature" now I guess (although I wonder how many unit tests implicitly exploit it).
from hyperon-experimental.
Related Issues (20)
- parse grounded operation is badly implemented HOT 5
- How to delay reduction until bindings are ready?
- get-doc units tests are slow
- Python package version is determined incorrectly in repository forks as "0.1.devX+Y" HOT 5
- py-atom problem with multiply import HOT 2
- Type checking doesn't work for tuples. HOT 2
- Type checking for the Symbol meta-type doesn't work properly HOT 1
- MeTTa should support single sided matching HOT 14
- !(import! &self lib) is not working for python libraries HOT 7
- Referential transparency on non-deterministic functions
- C interface does not build HOT 6
- Documenting how to use LLM gate and test_assist.metta HOT 2
- pkg_mgmt, Support for git-hosted modules specified with custom revisions &/or tags
- docker build fail HOT 1
- Release is broken: delocate tool finds inconsistencies in packages under macos-13 and macos-14 GitHub action environments HOT 4
- Have assertEqual support alpha equivalence HOT 5
- cargo run --features no_python --bin metta-repl before and after metta-repl HOT 10
- Build problem (no docker) C extension: conan delegating pybind11 build to cmake which conflicts with pyenv. HOT 7
- Linking to libssl, libcrypto and libz breaks manylinux compatibility according to PEP-513 HOT 2
- Documentation is not shows for the operations which are duplicated in Python and Rust stdlib when Python runner is used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperon-experimental.