Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erasure reduction: handle Skolemization inferences #589

Open
jvierling opened this issue Dec 3, 2016 · 1 comment
Open

erasure reduction: handle Skolemization inferences #589

jvierling opened this issue Dec 3, 2016 · 1 comment

Comments

@jvierling
Copy link
Contributor

I'm not sure if this is a bug or if it is due to some unsatisfied precondition in the input of the reduction.

import at.logic.gapt.expr._
import at.logic.gapt.formats.tip.TipSmtParser
import at.logic.gapt.proofs.Sequent
import at.logic.gapt.proofs.reduction.{ErasureReductionET, PredicateReductionET}
import at.logic.gapt.provers.spass.SPASS
import better.files._

import scalaz.Success

object Example {
  def main( args: Array[String] ): Unit = {
    val reduction = PredicateReductionET |> ErasureReductionET
    val tip     = TipSmtParser.fixupAndParse("./../benchmarks/benchmarks/tip2015/nat_pow_one.smt2".toFile)
    val problem = tip.toSequent
    implicit val context = tip.context
    sequentialInductionAxioms.inductionAxioms(problem.succedent.head, List(hov"x:Nat")) match {
      case Success(axioms) => {
        val sequent            = axioms ++: problem
        val (folProblem, back) = reduction forward (Sequent() :+ sequent.toImplication)
        SPASS.getExpansionProof(folProblem) map back
      }
    }
  }
}

The output is:

Exception in thread "main" scala.MatchError: (∀x_0 (P_is_Nat(x_0) ⊃
      f_pow(f_S(f_Z), x_0) = f_S(f_Z) ⊃
      f_pow(f_S(f_Z), f_S(x_0)) = f_S(f_Z)) +sk^{s_0}
  (P_is_Nat(s_0)- ⊃
    ((f_pow(f_S(f_Z), s_0) = f_S(f_Z))- ⊃
      (f_pow(f_S(f_Z), f_S(s_0)) = f_S(f_Z))+)),∀x_0 (is_Nat(x_0:Nat) ⊃
    (pow(S(#c(Z: Nat)): Nat, x_0): Nat) = S(#c(Z: Nat)) ⊃
    pow(S(#c(Z: Nat)), S(x_0)) = S(#c(Z: Nat)))) (of class scala.Tuple2)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:201)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:209)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:207)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:209)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper$$anonfun$back$8$$anonfun$apply$4.apply(manySorted.scala:227)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper$$anonfun$back$8$$anonfun$apply$4.apply(manySorted.scala:225)
	at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:683)
	at scala.collection.immutable.List.foreach(List.scala:381)
	at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:682)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper$$anonfun$back$8.apply(manySorted.scala:225)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper$$anonfun$back$8.apply(manySorted.scala:224)
	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
	at at.logic.gapt.proofs.Sequent.flatMap(sequents.scala:233)
	at at.logic.gapt.proofs.Sequent.flatMap(sequents.scala:217)
	at at.logic.gapt.proofs.reduction.ErasureReductionHelper.back(manySorted.scala:224)
	at at.logic.gapt.proofs.reduction.ErasureReductionET$$anonfun$forward$8.apply(manySorted.scala:270)
	at at.logic.gapt.proofs.reduction.ErasureReductionET$$anonfun$forward$8.apply(manySorted.scala:270)
	at at.logic.gapt.proofs.reduction.CombinedReduction$$anonfun$forward$1.apply(manySorted.scala:46)
	at scala.Option.map(Option.scala:146)
	at at.logic.gapt.provers.viper.Example$.main(Bug.scala:24)
	at at.logic.gapt.provers.viper.Example.main(Bug.scala)
@gebner
Copy link
Member

gebner commented Dec 3, 2016

Ah, looks like erasure reduction does not handle Skolemization. As a quick fix you could start with CNFReductionExpRes instead, then the further reductions will not see the strong quantifiers.

@gebner gebner changed the title ErasureReductionHelper.back throws scala.MatchError erasure reduction: handle Skolemization inferences Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants