Questions tagged [oz]

Oz is a multiparadigm programming language including logic, functional (both lazy and eager), imperative, object-oriented, constraint, distributed, and concurrent programming.

Oz is a multiparadigm programming language including logic, functional (both lazy and eager), imperative, object-oriented, constraint, distributed, and concurrent programming.

The major strengths of Oz are in constraint programming and distributed programming. Due to its factored design, Oz is able to successfully implement a network-transparent distributed programming model. This model makes it easy to program open, fault-tolerant applications within the language. For constraint programming, Oz introduces the idea of "computation spaces"; these allow user-defined search and distribution strategies orthogonal to the constraint domain.

A canonical book on Oz programming is Concepts, Techniques, and Models of Computer Programming.

For more information, see the Mozart programming system, which is a multiplatform implementation of the Oz programming language.

110 questions
1
vote
1 answer

Boolean and logical operators

I'm a begginer in Mozart-Oz, and I seek help because this language is not very intuitive, and lacks documentation. I'm trying to apply this code (which works on eclipse when i write it in java) and doesn't work in oz, here are the details: This is…
user3078046
  • 31
  • 1
  • 7
1
vote
1 answer

Oz Mozart factorial function

I have this factorial function that is currently working, but the result I'm having is not the one I need. The code is: declare fun {Fact N} if N==1 then [N] else Out={Fact N-1}in N*Out.1|Out end end {Browse {Fact 4}} The result is :…
Anita
  • 43
  • 5
1
vote
2 answers

Oz/Emacs: Browse isn't opening

I'm following the book Concepts, Techniques and Models of Computer Programming. The code: {Browse 9*9} When I select the code and select feed region on OZ menu, the following happens: {Browse 9*9} % -------------- accepted But the Browse window…
Mateus Pires
  • 903
  • 2
  • 11
  • 30
1
vote
1 answer

ActiveTcl doesn't show thew the output when used with emacs and oz (Mozart 2)

I have applied for an online course which requires using Mozart with emacs and ActiveTcl. I have installed all of them based on the provided tutorial but when I feed a simple line of code like: {Browse 5+3} All I've got is: {Browse 5+3} %…
Hessam
  • 1,377
  • 1
  • 23
  • 45
1
vote
1 answer

Dynamically evaluating code (like eval())

Is it possible to evaluate code (as string or syntax list) at runtime (like eval()) in Oz? It is a dynamically typed language, so it may be possible.
ThePiercingPrince
  • 1,873
  • 13
  • 21
1
vote
2 answers

Run Mozart/Oz system within GNU Emacs on OSX instead of Aquamacs

Is it possible to make Mozart/Oz system run within GNU Emacs on OSX instead of Aquamacs which I dislike? I tried copying /Applications/Emacs to /Applications/Aquamacs but had no luck.
Tvaroh
  • 6,645
  • 4
  • 51
  • 55
1
vote
2 answers

How to write a simple higher order function in mozart oz?

I am a beginner in mozart oz, and I would like to write a simple higher order function, like {{Add 1}2}, the result of which has to be 3. I guess this is something like nested call in C, where a function could call itself? I am not sure how to…
phil
  • 255
  • 4
  • 16
1
vote
0 answers

Test for unification in Oz

What I want to do is, test if a certain expression unifies with another in Oz. For example, I want to do something like this: fun {UnifyP A B} ... end that can return true when A can be unified to B and false else. I want to use it to do a…
mhourdakis
  • 179
  • 8
0
votes
1 answer

Function recursion, what happens in the SAS?

I have this scenario: a recursive procedure (or function) is called like {DoSomething Data C} and C is the variable that should store the final result, the function prototype is proc {DoSomething Data N} %.. %.. {DoSomething Data…
0
votes
0 answers

divide a list into two sublists in Oz

Create a function in Oz that takes as input a list of integers. The function's outputs are two lists: the first list contains even numbers the second list odd numbers. The two lists are separated by a #. Es. {Browse {F [1 2 3 4]}} -----> [1 3]#[2…
0
votes
1 answer

Prime or not using oz language

I am trying to make a function to check whether the value is a prime number or not using tail recursive function, so please can someone help me with this ` declare fun {PrimeR X D} if X==2 orelse X==3 then 1 elseif X<2 andthen ((X mod D)==0)…
0
votes
1 answer

Implementing a concurrent program that keeps track of the occurrences of characters in a input stream

How does one approach this type of concurrent stream communication program? local InS in {Browse {Counter InS}} InS=a|b|a|c|_ end One should see in the browser [a#1]|[a#1 b#1]|[a#2 b#1]|[a#2 b#1 c#1]|_ A sequential program would be trivial, but…
scsi
  • 13
  • 3
0
votes
0 answers

Oz language program for calculating the power of a number keeps getting errors

declare fun {Power N M} if M == 0 then 1 else local X in {power N M div 2} if {M mod 2 } == 0 then X*X else N*X*X end end end {browse power 2 8 } I keep getting errors for this program,…
0
votes
1 answer

OZ Programming language: Boolean guard

I am taking a subject at school which require us to use the Mozart Programming Interface. I do not really think much of it so far. But anyways, here is the question: In OZ you are only allowed to assign a variable once (it can't be reassigned but…
thomrand
  • 85
  • 6
0
votes
1 answer

What is an alternative Filter operation with better concurrency (code)?

The following is a naive attempt to increase the concurrency of the Filter function: fun {Filter L F} case L of X|Xs then if thread {F X} end then X|{Filter Xs F} else {Filter Xs F} end …