Questions tagged [quantifiers]

In logic, quantification is the binding of a variable ranging over a domain. The variable thereby becomes bound by an operator called a quantifier.

In logic, quantification is the binding of a variable ranging over a domain. The variable thereby becomes bound by an operator called a quantifier.

The two fundamental kinds of quantification in predicate logic are universal quantification and existential quantification.

233 questions
2
votes
1 answer

Mixed quantification in Answer Set Programming

I would like to be able to formulate the following FOL sentence in ASP/clingo: ∀ X. prop(X) ⇐ (∃ Y. ∀ V. ∃ A. (p(Y, V, A) ∧ q(X, V, A)) ) The domain of both X and Y is given by dom/1. The domain for A is given by…
2
votes
1 answer

Alternation of quantifiers in Z3?

using z3py API. Reading from advanced examples Every example has a universal quantifier outside. Would like to use quantifier alternation. For example: for_all X exists Y One instance that I think it's useful is (for all graphs exists a…
user2754673
  • 439
  • 3
  • 13
2
votes
1 answer

z3 quantifiers elimination in SMTLIB syntax

I have the following example of quantifiers elimination using z3py below. However I would like to rewrite it using SMTLIB syntax (code below python code). Somehow I did not get the same output like what I got from python which are formulas. I wonder…
psksvp
  • 139
  • 11
2
votes
2 answers

How to implement existential quantifiers in OO programming?

It's easy to asses and implement logic formulas including universal quantifiers via (nested) foreach or for loops: (\forall x \in X)(\forall y \in Y) (Z(x,y)) foreach (type x in X) { foreach (type y in Y) { if(Z(x,y)) return…
User
  • 952
  • 2
  • 21
  • 43
2
votes
2 answers

How to make a list with options, of which one is compulsory in regex, R?

I am suffering from a regex problem in R here. I have three sentences: s1 <- "today john jack and joe go to the beach" s2 <- "today joe and john go to the beach" s3 <- "today jack and joe go to the beach" I want to know of each sentence whether…
2
votes
1 answer

Why does my regex group quantifier not work?

I try to write some regex for Dutch license plates (kentekens), the documentation is very clear and I only want to check them on format, not if the actual alpha character is possible for now. My regex (regex101) looks as…
online Thomas
  • 8,864
  • 6
  • 44
  • 85
2
votes
1 answer

Lemma/rule to allow substitution in universally quantified variable (Isabelle)

I have a goal which looks something like "\x. \y.\(z::real). P x y z". Is there a rule which immediately allows me to conclude "\x. \y.\(z::real). P x y (z-2)"? If there isn't, I'd appreciate general…
user2757762
2
votes
1 answer

java lookbehind for split by greedy quantifiers expressions

I wrote the following expression to split a string after every x word (3 for instance) followed by a space. My problem is that I need to keep the entire content. But I cannot find a way to use look behind etc to accomplish this in Java. Anyone has…
zeroworld
  • 23
  • 5
2
votes
1 answer

What does ⋀ mean in Isabelle?

(This is pretty much a logic question.) ⋀ such as in ⋀y . Py seems to be a kind of placeholder. It occurs after using apply (rule allI) or apply (erule exE. At first I thought it was like a pretend ∀, because of the rule allI which is (!!x. Px) =>…
IIM
  • 533
  • 3
  • 11
2
votes
1 answer

How to findall for universal facts in prolog?

In Prolog I can write child(martha,charlotte). child(charlotte,caroline). child(caroline,laura). child(laura,rose). descend(X,Y) :- child(X,Y). descend(X,Y) :- child(X,Z), descend(Z,Y). And then write ?- …
Luxspes
  • 6,268
  • 2
  • 28
  • 31
2
votes
1 answer

Bounding universally quantified variable

I would like to know if it is possible to bound the range of values of a universally quantified variable in Z3. For example, let's assume that I have a variable of type Real called "time" which is used to model the time in the system. Let's say that…
predragf
  • 43
  • 4
2
votes
1 answer

Quantifiers in Z3

Basically, I want to ask Z3 to give me an arbitrary integer whose value is greater than 10. So I write the following statements: (declare-const x (Int)) (assert (forall ((i Int)) (> i 10))) (check-sat) (get-value(x)) How can I apply this quantifier…
Mahsa
  • 31
  • 2
2
votes
1 answer

Defining Rules for Bit Vectors in SMT2

I have switched from using Int to Bit Vectors in SMT. However, the logic QF_BV does not allow the use of any quantifiers in your script, and I need to define FOL rules. I know how to eliminate existential quantifiers, but universal quantifiers? How…
Arya Pourtabatabaie
  • 705
  • 2
  • 7
  • 22
2
votes
2 answers

Is there a way to expand the scope of an existential type quantifier in Scala to convince the type checker that two variables have the same type?

Consider the following code snippet: case class Foo[A](a:A) case class Bar[A](a:A) def f[B](foo:Foo[Seq[B]], bar:Bar[Seq[B]]) = foo.a ++ bar.a val s : Seq[T] forSome {type T} = Seq(1, 2, 3) f(Foo(s), Bar(s)) The last line fails to type check,…
iansimon
  • 43
  • 5
2
votes
3 answers

regex lookahead problems with greedy quantifier

Need to support the following formats 3 digits followed by optional space followed by three non-repeating characters specified within the following character set ACERV (space is valid only between the two characters) Valid formats: 123 123 A 123 A…