Questions tagged [predicates]

Predicates are functions that return the boolean values, `True` or `False`.

In computing, Predicates are functions that return the boolean values, True or False. Some languages and frameworks treat them specially.

See also Wikipedia.

There are alternate (and possibly more mainstream) meanings. See Wikipedia.

108 questions
1
vote
1 answer

Using predicates in Spring route definition does not work

I am trying to define a Route using Spring's WebFlux modules. Here is my route defintion: @Bean public RouterFunction routes(Handler handler) { Predicate predicate = headers -> headers.equals("clientId"); return …
deepak
  • 339
  • 6
  • 16
1
vote
1 answer

Finding a loop invariant - Hoare Triple

From the following code, I need to deduce/choose a loop invariant. (|true|) x = 0 ; s = 0 ; while ( x <= n ) { s = s + x ; x = x + 1 ; } (|s = n(n + 1)/2|) Solution given was s = (x-1)*x/2 ∧ (x ≤ n +1) I don't quite understand how it has…
user6797155
1
vote
1 answer

Proof in coq - Predicate logic

Trying to prove the following in coq: Prove that the universal quantifier distributes over conjunction ∀x ∈ A, P x ∧ Qx ⇐⇒ (∀x ∈ A, P x) ∧ (∀x ∈ A, Qx) My Proof so far- Parameter (A : Type). Parameter (P Q : A -> Prop). Lemma II3: (forall x : A, P…
maria
  • 11
  • 2
1
vote
2 answers

Oracle 11 joining with view has high cost

I'm having some difficulty with joining a view to another table. This is on an Oracle RAC system running 11.2 I'll try and give as much detail as possible without going into specific table structures as my company would not like that. You all…
Rod Meyer
  • 568
  • 4
  • 7
1
vote
1 answer

Trying to join tables with predicate builder

I have two tables that I want to join using predicate builder. In pseudo code, I want to return all StudentSchedule rows, joining with Student on StudentId, where StudentLastName = "Smith". public class Student { int StudentId {get;set;} …
Amanda_Panda
  • 1,156
  • 4
  • 26
  • 68
1
vote
1 answer

Spring Data Specifications - how can I filter objects by mulitple attributes

I'm trying to implement searching of users by mulitple attributes. Let's say, my Person has Name and Lastname. I want to type 'Michael Doe' and list all persons with this name and lastname. When I type only 'Michael', I want all Michaels and so…
Adam De
  • 131
  • 1
  • 2
  • 8
1
vote
1 answer

Version Portable for Hazelcast : Converting Date to Long throws Exception in Predicates

I am trying to use com.hazelcast.nio.serialization.VersionedPortable for serialization for a Customer class. This does not support Date serialization by default. So we need to convert it to Long @Override public void writePortable(PortableWriter…
1
vote
1 answer

java spring jpa specification predicates array for search

I want to create a search in my java spring boot application ,and i'm using "Spring Data JPA" specification.I want to know how to use multiple predicates in "Spring Data jpa" specification.Here the example i refer.
Hasitha Diluka
  • 766
  • 6
  • 13
1
vote
2 answers

Have hazelcast predicate return sorted collection

is there a way to get a sorted collection from a hazelcast predicate? i have found that hazelcast offers a pagingpredicate for this purpose but i am not interested in the paging behavior (at least for now). even if one does use this pagingpredicate,…
h.i
  • 515
  • 1
  • 5
  • 16
1
vote
1 answer

LinqKit Predicates

I am trying to figure out how the Predicates work. I have a piece of code where one parameter will always be supplied but there could be up to 5 different parameters. If I try this way var predicate =…
Luckbox72
  • 147
  • 1
  • 2
  • 16
1
vote
1 answer

Applying hypotesis to a variable

Let's say I'm in the middle of a proof and I have hypotheses like these: a : nat b : nat c : nat H : somePred a b and the definition of somePred says: Definition somePred (p:nat) (q:nat) : Prop := forall (x : nat), P(x, p, q). How do I apply H to…
poe123
  • 1,188
  • 8
  • 11
1
vote
2 answers

Prolog dict predicate matching

Given this program, why am I forced to define every atom in the predicate, even if they're anonymous. Why is it that undefined variables in a dict predicate aren't thought of as anonymous? funt2(X) :- X = point{x:5, y:6}. evalfunt(point{x:5, y…
Brian Rosamilia
  • 1,448
  • 14
  • 24
1
vote
1 answer

Querying Realm database to return dates

I have a realm database and I'm trying to return dates. My query is as follows: var jobsReturned = JobDates.objectsWhere("jobRestarted <= '\(testDate)' ") The problem I'm getting is when I test I get an error that states, "Terminating app due to…
Tom
  • 790
  • 2
  • 9
  • 32
1
vote
1 answer

Filter a MultiMap

Block are some long-lived instances representing types, e.g. A Minecraft BlockType grass, green_wool etc. I'm trying to find a DataStructure that can efficiently store and test for a given BlockPattern (think like, an obsidian portal, Wither etc if…
Ryan Leach
  • 4,262
  • 5
  • 34
  • 71
1
vote
2 answers

Clojure take-while with logical and

I am learning Clojure and trying to solve Project's Euler (http://projecteuler.net/) problems using this language. Second problem asks to find the sum of the even-valued terms in Fibonacci sequence whose values do not exceed four million. I've…
Shkarik
  • 1,139
  • 2
  • 9
  • 17