Declarative programming is a paradigm of expressing the logic of a computer program or computation without explicit describing its control flow.
Questions tagged [declarative-programming]
78 questions
0
votes
1 answer
Changing service code for object inside a system in Alloy
I want to change the service code of an object whenever there has been any service operated upon it. Suppose, I have a operation whenever that applies to an object, the service code of that object will be 1 and again when another operation executes…

faysal
- 162
- 2
- 14
0
votes
1 answer
wrong sig object get referenced to while executing state in Alloy
I am new to Alloy. I am trying to formalize a system using Alloy. Here I want to execute certain operations based on the events. For this, I have a list of events that I want to track using enum Event. And I am going through all the State using…

faysal
- 162
- 2
- 14
0
votes
1 answer
Value assignment in Alloy and use of Enum
How to assign variable in Alloy?
Sig ClassA{
variable_1: String,
variable_2: Int
}
Sig ClassB{
variable_1: String,
variable_2: Int
}
pred isLess[a:ClassA,b:ClassB]{
a.variable_2 < b.variable_2
}
assert integrityTest{
all…

faysal
- 162
- 2
- 14
0
votes
2 answers
Declarative language support in .NET
I am developing a simulation engine with Visual Studio that will offer support for building business process simulations. One of the key features will be a declarative language that will allow business users to setup quickly a simulation model. I…

Dimitris
- 2,030
- 3
- 27
- 45
0
votes
0 answers
The price of reading a variable
Suppose that we have variable (x) allocated in the memory and assigned a constant value (v). Are there cases where the operation of reading the content of the variable changes its value?
Thanks.

rmas
- 19
- 5
0
votes
3 answers
ASP.NET is based on declarative programming?
Recently I have noticed about a subtle restriction in GridView's paging mechanism. Efficient paging, loading just requested page of data, is only possible with using DataSource controls like ObjectDataSource that means declarative data binding and…

Afshar Mohebi
- 10,479
- 17
- 82
- 126
0
votes
0 answers
Verifiying the structural regularities in software change contracts
I am doing my project to create a tool that can find the changes in the structural regularities (the structural regularities are rules which must be obeyed in the source code) between two versions of a specific software and check if the newest…

user3006595
- 31
- 5
0
votes
1 answer
Not sufficiently instantiated for maplist(all_distinct, list)
I'm not able to run this code, what exactly do I have to say about the list to allow maplist/2 to run all_distinct/1?
Solution = [A, B, C, D, E, F, G, H, I],
Solution ins 1..9,
maplist(all_distinct, Solution).
I get ERROR: Arguments are not…

jboulter11
- 152
- 1
- 2
- 12
0
votes
2 answers
Why doesn't any object prototype work as a forEach callback?
Rather than a question, I just wanted it to be a challenge but couldn't find an answer yet.
For example, we have an array of strings
x = ['a', ' b', ' c ']
and I want to trim all the elements. I tried apply and call methods but neither worked…

Cihad Turhan
- 2,749
- 6
- 28
- 45
0
votes
1 answer
Prolog, List of lists contains another list exactly
What I basically want to achieve is, that given a list of lists A, I want a predicate that checks if the elements of a list B are exactly contained in list A.
So for example:
A = [[1,2],[3,4],[5],[]]
B = [1,2,3,4,5]
and
A = [[1,2],[3,4],[5],[]]
B =…

voluminat0
- 866
- 2
- 11
- 21
0
votes
4 answers
More efficient version of this R loop
I'm used to Python and JS, and pretty new to R, but enjoying it for data analysis. I was looking to create a new field in my data frame, based on some if/else logic, and tried to do it in a standard/procedural way:
for (i in 1:nrow(df)) {
if…

yashap
- 45
- 5
0
votes
1 answer
Oracle ADF and SalesForce Integration
I am trying to integrate ADF application to SalesForce. I have my enterprise URL and api-token and password. I am able to call services and get results from soapUI.
Now the challenge is I'd like to integrate salesforce and get data to ADF…

Raja Vaida
- 23
- 4
-1
votes
1 answer
How to use the Java Filter method to filter with a dynamic parameter?
What is the correct way to filter elements of a list with declarative programming?
My idea is to create a new list with more specific elements. For example having a new list only dates from a date specified by the user.
import…

Leo Odriozola
- 41
- 4
-1
votes
2 answers
Is unix's 'cp' command declarative or imperative?
I'm having a discussion with a coworker, who insists cp is declarative. To me, it seems very imperative. It's an instruction we are asking the computer to do, not a definition or declaration. For it to be declarative, instead of:
cp a.zip b.zip
you…

Dominic Bou-Samra
- 14,799
- 26
- 100
- 156
-1
votes
1 answer
Reasoning in prolog issue
foo([], Res).
foo([schedule(_, X)|Tail], Res) :- append(Res, X, Res2),
foo(Tail, Res2).
Expected result:
X is a list of values, Res is where the result should be stored.
Imagine that I…

voluminat0
- 866
- 2
- 11
- 21