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
3
votes
1 answer

Is it a bug in Z3? Incorrect answer on Real and ForAll applied

I'm trying to find the minimal value of the Parabola y=(x+2)**2-3, apparently, the answer should be y==-3, when x ==-2. But z3 gives the answer [x = 0, y = 1], which doesn't meet the ForAll assertion. Am I assuming wrongly with something? Here is…
wsysuper
  • 146
  • 6
3
votes
1 answer

Apache mod_rewrite regex limit match max quantifier?

I use match quantifier {} in mod_rewrite regex, rewrite rule work if quantifier match up 1 or 2 times, and not work if match up 3 and more times. Why? Example .htaccess file: This work (i require mydomain.com/download.ex): RewriteEngine…
Andrey
  • 1,183
  • 1
  • 9
  • 10
3
votes
1 answer

Surprising behaviour when trying to prove a forall

Consider the following SMT-LIB code: (set-option :auto_config false) (set-option :smt.mbqi false) ; (set-option :smt.case_split 3) (set-option :smt.qi.profile true) (declare-const x Int) (declare-fun trigF (Int Int Int) Bool) (declare-fun trigF$…
Malte Schwerhoff
  • 12,684
  • 4
  • 41
  • 71
3
votes
3 answers

Regex - match range of characters with a quantifier that only matches numbers

I've found a similar question on SO, but nothing I can get my head around. Here's what I need; 6 or more digits, with these characters allowed \s\-\(\)\+ So here's what I have /^[0-9\s\-\(\)\+]{6,}$/ The problem is, I don't want anything other than…
Dan
  • 550
  • 4
  • 10
  • 21
3
votes
2 answers

Quantifier Elimination for LIA in Z3 via C/C++ API

I would like to use Z3 for eliminating quantifiers in linear integer arithmetic formulas via C/C++ API. Consider a simple example: Exists (x) ( x <= y & y <= 2*x). A quantifier-free formula with the same models is y >= 0. I tried to do it this…
Egbert
  • 157
  • 9
2
votes
3 answers

Ambiguous type using explicit quantifiers

Minimal example code: class IntegralAsType a where value :: (Integral b) => a -> b class (Num a, Fractional a, IntegralAsType q) => Zq q a | a -> q where changeBase:: forall p b . (Zq q a, Zq p b) => a -> b newtype (IntegralAsType q, Integral…
crockeea
  • 21,651
  • 10
  • 48
  • 101
2
votes
1 answer

How to define a data type with an explicit kind quantification?

When I define data Foo a = Foo [a] then the type is of kind Foo :: * -> *. Having enabled PolyKinds and RankNTypes I'd like to explicitly quantify it with a more general kind signature Foo :: forall k . k -> k. However none of my attempts…
Petr
  • 62,528
  • 13
  • 153
  • 317
2
votes
1 answer

What does a model mean in a universally quantified formula? Is it a function?

Consider these two formulae: Exists y. Forall x. (y>x), which is unsat. Forall x. Exists y. (y>x), which is sat. Note that we cannot find “models” for the sat formula, e.g., using Z3 it outputs Z3Exception: model is not available for the following…
Theo Deep
  • 666
  • 4
  • 15
2
votes
1 answer

Z3 cannot check equivalence of two formulae

(Why are not the math formulae showing correctly?) I am performing a test over the Z3 library in Python (Collab) to see whether it knows to distinguish formulae. The test is the following: (1) I make a quantifier elimination over a formula $phi_1$,…
Theo Deep
  • 666
  • 4
  • 15
2
votes
1 answer

Type variable introduction for existential types

Is there any binder in haskell to introduce a type variable (and constraints) quantified in a type ? I can add an extra argument, but it defeats the purpose. {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE…
nicolas
  • 9,549
  • 3
  • 39
  • 83
2
votes
2 answers

How can I access capture buffers in brackets with quantifiers?

How can I access capture buffers in brackets with quantifiers? #!/usr/local/bin/perl use warnings; use 5.014; my $string = '12 34 56 78 90'; say $string =~ s/(?:(\S+)\s){2}/$1,$2,/r; # Use of uninitialized value $2 in concatenation (.) or string…
sid_com
  • 24,137
  • 26
  • 96
  • 187
2
votes
2 answers

regex quantifiers in bash --simple vs extended matching {n} times

I'm using the bash shell and trying to list files in a directory whose names match regex patterns. Some of these patterns work, while others don't. For example, the * wildcard is fine: $ls FILE_* FILE_123.txt FILE_2345.txt FILE_789.txt And the…
Jabber1
  • 69
  • 5
2
votes
1 answer

Javascript regular expression quantifiers: what does it mean to match zero or more times

So I am just trying to clarify what exactly the * quantifier in a javascript regular expression does. The definition from MDN states the following: x* Matches the preceding item "x" 0 or more times. For example, /bo*/ matches "boooo" in "A ghost…
Austin737
  • 675
  • 1
  • 8
  • 15
2
votes
6 answers

Perl REGEX Question

As a PHP programmer new to Perl working through 'Programming Perl', I have come across the following regex: /^(.*?): (.*)$/; This regex is intended to parse an email header and insert it into a hash. The email header is contained in a seperate…
pb149
  • 2,298
  • 1
  • 22
  • 30
2
votes
1 answer

Counting number of variables in Z3 quantified formula

I'm trying to collect all the variables in a formula (quantified formula in Z3py). A small example w, x, y, z = Bools('w x y z') fml = And( ForAll(x, ForAll(y, And(x, y))), ForAll(z, ForAll(w, And(z, w))) ) varSet = traverse( fml ) The code i…
Pushpa
  • 448
  • 3
  • 10