Declarative programming is a paradigm of expressing the logic of a computer program or computation without explicit describing its control flow.
Questions tagged [declarative]
365 questions
0
votes
2 answers
Prolog query issue
Ok, let's say i have these two facts:
data1([50, 20, 15, 20, 25, 20, 84]).
data2([50, 30, 15, 5, 10, 18, 60]).
I want to make a query that asks whether the N-th element of the list defined as a part of those facts is some value.
query([L1|Tail]) :-…

user361633
- 203
- 1
- 11
0
votes
1 answer
How I can add all the data in a knowledge base in Prolog?
I need help with this exercise of Prolog:
% items
items (cell).
items (labial).
items (control).
items (mirror).
% Weight of each item
weight (cell 2).
weight (labial, 3).
weight (control, 5).
weight (mirror, 10).
capacity (X, Y, Z, V) :-
…

Marztres
- 460
- 8
- 15
0
votes
1 answer
Problem with declarative statement at asp.net 2.0
wanna ask you for help. I am bit lost with declarative statement in asp.net 2.0.
I want add specific class "selected" or "noselected" for A tag when current path is equal to path I provide. I tried st., but it is not working. The code is…

Jaroslav Urban
- 1,269
- 3
- 20
- 32
0
votes
1 answer
Global variable in unbind method of OSGi service is null
My application is based on OSGi (Equinox). A OSGi service binds another service by defining a Component XML and bind / unbind methods in the appropriate class.
In the unbind method the value of a global String variable (same class like unbind…

user1056903
- 921
- 9
- 26
0
votes
1 answer
write_canonical() and natural language interpretation
Implement the following two operators has and of in such a way that
with phrases like: peter has car of john answers to questions such as:
Who has What of X
I have this simple program that define two operator: has (that specify who have what)…

AndreaNobili
- 40,955
- 107
- 324
- 596
0
votes
1 answer
How can I do this without a cursor or loop?
I hear to use Declarative programming but I have no idea how to do something like this in sql server 2005
(I typed this up really fast so I'm not sure if all the syntax is correct but I think you'll understand what I'm looking for)
declare curs…

user204588
- 1,613
- 4
- 31
- 50
0
votes
1 answer
How can I represent business rules in Excel financial models?
I'm creating a "one-period" financial model in Excel - that is, a model where the formulas are consistent in each column, so you can copy/paste/extend them as desired.
I'm breaking out the model's assumptions into a separate sheet. For instance, I…

Jay Levitt
- 1,680
- 1
- 19
- 28
0
votes
1 answer
SharepPoint 2010 Feature Upgrade Action rename field declarative way
I'm looking into Sharepoint 2010 Feature upgrade framework and all over the net I'm seeing examples of how to upgrade a feature by adding a new field to a existing content type and this is done like this:

Narcis
- 5,862
- 3
- 23
- 30
0
votes
1 answer
What specific problems does Declarative Programming solve best?
I understand what declarative languages have to offer, but I have not yet connected the dots as to why I would use them. For example, I do not understand why describing a problem is more beneficial than writing a solution to an already understood…

Sage Gerard
- 1,311
- 8
- 29
0
votes
1 answer
Asp.Net ListView LinqDataSource Declaratively Bind Child Objects
I have a ListView with a LinqDataSource. In the Edit Template we need to edit both the primary object and a related (1 to 1) child object.
In the past I have used code for all of this and manually handled Updates, but I am wondering whether there…

Serexx
- 1,232
- 1
- 15
- 32
-1
votes
2 answers
How to get this Prolog program to work
I am currently trying to create a program that takes two inputs a base and an exponent, so basically im going to ask for those two things for example if the user of Prolog inputs base 2 and exponent 3, I want it to return 8.., Here is what I got so…

Steven Corea
- 43
- 1
- 1
- 6
-1
votes
1 answer
am I using anti-patterns in this implementation?
what i want to to in this component is straight-forward getting data of a selected question by the route id param.
difference is that i'm trying to make things as declarative as possible so my component looks like this:
export class…

Mando
- 33
- 4
-1
votes
4 answers
How to avoid using subscriptions and BehaviorSubject.value using a declarative approach in rxjs
While refactoring my angular application I basically want to get rid of all subscriptions in order to use only async pipe provided by angular (just a declarative approach instead of an imperative one).
I have problems to implement a declarative…

Fabian Strathaus
- 3,192
- 1
- 4
- 26
-1
votes
1 answer
Simple infinite iterator in Python
a few days ago I started working in my friend's startup as junior Python developer, we are the only employees.
I have noticed he sometimes writes strange code. For example this:
@pytest.fixture
def create_user_model_test_data():
…

Pablo
- 37
- 5
-1
votes
2 answers
What are the differences between imperative and functional programming languages?
What is the definitive answer regarding the differences between imperative languages and functional (a sub-set of declarative) programming languages, and can it be explained with practical examples? What are some of the main or most important…

Marcelo
- 21
- 1