Comments (5)
I think the right change would rather be on the ReversePowersetLattice
.
Note that the approach of using the characteristic function still allows you to pass a Set to construct the lattice as Set[A]
extends (A) => Boolean
: http://www.scala-lang.org/api/2.12.3/scala/collection/Set.html
from tip.
I take your point. On the other hand, Idea doesn't seem to recognize the type A
if I just replace s: Set[A]
by ch: A => Boolean
in the ReversePowersetLattice
, e.g., it complains about the AvailableExpAnalysis
and doesn't compile. Adding asInstanceOf
operators fix the problem but it doesn't seem to be a good style. However, I'm a Scala novice and might have missed an elegant way of solving it.
By the way, I'm curious whether there exists a use case where defining a lattice over a subset of a type, that itself does not form a type, is needed.
from tip.
Quickfix: replacing s: Set[A]
by ch: A => Boolean
works well for my reaching definitions analysis implementation. However, there are still typing warnings from Idea that can be eliminated by asInstanceOf
. And it requires explicit construction of the bottom element in the ReversePowersetLattice
.
from tip.
-
As for the use case, having something to pass when constructing the object save us from annotating the generic type. Moreover if you want to be pedantic/defensive the powerset lattice implementation coud check that the lub operation is performed on sets that are subset of the one denoted by
ch
-
As for the Idea warnings, Idea scala plugin is not as clever as the scala compiler. You have to live with them. I think there is some work going on for making a Language Server for giving the editors compiler info, but I guess we have to wait for that.
from tip.
- Thank you! The lub return was one of my concerns as well.
- Thanks for clarification!
from tip.
Related Issues (13)
- -
- Context-sensitive interprocedural analysis HOT 1
- Clean up parser and AST
- Normalization
- Wrong filename in exercise 3 HOT 1
- IntelliJ doesn't pick up SBT project HOT 3
- Implementation missing? HOT 2
- Check language assumptions
- Extend AndersenAnalysis and SteensgaardAnalysis to interprocedural
- Extend the flow-sensitive analyses with variations like SignAnalysis
- New analysis: EscapeAnalysis
- New analysis: NullPointerAnalysis
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tip.